Re: [校園] 台大博士與他的巨匠夢

看板NTU作者 (馬士登)時間7年前 (2017/03/04 20:30), 7年前編輯推噓13(13013)
留言26則, 17人參與, 最新討論串2/2 (看更多)
: 推 jonathan793: 昨天夢到要看用空白鍵縮排的python code 03/03 23:38 : → jonathan793: 嚇掉我的毛 03/03 23:38 安安泥豪,請問泥對用空白縮排的 Python Code 有什麼意見麻? 小魯妹最近剛學 Python 不太懂 > "" < https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces 這篇是來自 Python 社群給的 PEP (Python Enhancement Proposals) 作者三位分別是: 程式語言 Python 的老爹 Guido van Rossum Nick Coghlan 直議器 JPython 維護者 Barry Warsaw -- Tabs or Spaces? Spaces are the preferred indentation method. Tabs should be used solely to remain consistent with code that is already indented with tabs. Python 3 disallows mixing the use of tabs and spaces for indentation. Python 2 code indented with a mixture of tabs and spaces should be converted to using spaces exclusively. When invoking the Python 2 command line interpreter with the -t option, it issues warnings about code that illegally mixes tabs and spaces. When using -tt these warnings become errors. These options are highly recommended! -- 所以到底用空格進行縮排是可以還4不可以喇? 泥搞得我好亂ㄛ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.35.232 ※ 文章網址: https://www.ptt.cc/bbs/NTU/M.1488630653.A.5A4.html

03/04 20:54, , 1F
makefile表示: 我需要tab
03/04 20:54, 1F

03/04 20:55, , 2F
小妹都彈粗奶喏
03/04 20:55, 2F

03/04 21:01, , 3F
我就是不知道這種 Coding Style 的東西有什麼好拿來戰文
03/04 21:01, 3F

03/04 21:02, , 4F
理組的?makefile 要 tab, BSD 下慣用 tab, 習慣而已。
03/04 21:02, 4F

03/04 21:03, , 5F
Python 用縮排來識別區塊, tab 又會根據不同的環境有長度
03/04 21:03, 5F

03/04 21:03, , 6F
問題, 用空格來排的程式碼有需要被嚇醒?
03/04 21:03, 6F

03/04 21:36, , 7F
對阿XD 電機系的 Ric 老師說 Space 是正解
03/04 21:36, 7F

03/04 23:36, , 8F
本來就是個人習慣啊ㄏㄏ makefile除外
03/04 23:36, 8F

03/05 01:54, , 9F
你如果有接手過別人縮排不整齊的的code,IndentError會
03/05 01:54, 9F

03/05 01:54, , 10F
讓你忙不完。
03/05 01:54, 10F

03/05 01:55, , 11F
Best case 是大家編輯器都用一樣的甚至連習慣也差不多
03/05 01:55, 11F
安安,所以我就不知道他在酸什麼惹 我以為 Python 用空格縮排是多數人的習慣耶 ※ 編輯: Marsden (140.112.35.232), 03/05/2017 02:36:04

03/05 04:06, , 12F
看到他毛掉滿地我也嚇到原來python 用space縮排是錯的RR
03/05 04:06, 12F

03/05 04:06, , 13F
RRRRR
03/05 04:06, 13F

03/05 04:58, , 14F
Space +1
03/05 04:58, 14F

03/05 08:53, , 15F
我用tab, 很多編輯器可以幫你設定tab等於多少空白 這
03/05 08:53, 15F

03/05 08:53, , 16F
有啥好戰的 ?嗆人用space的根本菜
03/05 08:53, 16F

03/05 08:58, , 17F
Expandtab就好也要戰...無言
03/05 08:58, 17F

03/05 11:55, , 18F
原po是真小妹我名字倒過來寫
03/05 11:55, 18F

03/05 11:55, , 19F
tab就是比較快
03/05 11:55, 19F

03/05 12:48, , 20F
這也要戰?改個.vimrc很難嗎?
03/05 12:48, 20F

03/05 13:18, , 21F
還好我都expand tab
03/05 13:18, 21F

03/05 13:59, , 22F
Richard Hendricks對於用space表示不悅XD
03/05 13:59, 22F

03/05 16:12, , 23F
NTU點?
03/05 16:12, 23F

03/05 17:38, , 24F
回文也要NTU點逆?
03/05 17:38, 24F

03/06 00:16, , 25F
我有發現會在網路上高談闊論嘴別人coding的通常都不怎樣
03/06 00:16, 25F

03/06 00:20, , 26F
樓上中肯
03/06 00:20, 26F
文章代碼(AID): #1OkhDzMa (NTU)
文章代碼(AID): #1OkhDzMa (NTU)