Hacker News new | past | comments | ask | show | jobs | submit login

From PEP-8, "Use 4 spaces per indentation level. For really old code that you don't want to mess up, you can continue to use 8-space tabs." [1].

While I agree on ending the '\r\n' mania(which itself is a very hard task), pushing tab stops down my throat is not cool.

[1]: http://www.python.org/dev/peps/pep-0008/




I have no problem with people using 4 spaces for indentation.

However, damned shall be those who think that tabs are anything but 8 spaces wide and actually use them this way in their code. Tabs really are 8 spaces wide and every terminal will tell you so.

Real world example: just yesterday I've been bitten by Eclipse defaulting to use "4 space wide tabs" for indentation in otherwise space-indented codebase. Everything looked nice and cool until I ran git diff. How could Eclipse developers think that it was a good idea?


Eclipse is very goofy about this, and it's something I loathed about using it (having recently switched to IntelliJ, which is better but not by an order of magnitude). In my experience, it will sometimes indent according to your settings, spaces or tabs, but at other times, based on some other setting that is in a different place than the first, it will indent based on the line previous to the one you are indenting. This results in a kind of slow creep of badly formatted code entering the codebase, if you have a lot of developers who don't care or don't know to check whitespace upon commit, and don't explicitly share a well-customized settings file.

At least IntelliJ has Emacs-style DWIM tab, but still has a whole host of problems with its better than Eclipse but still subpar editor.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: