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

8 characters tab width is insane. :(



Roundness of the Earth is equally insane. But both are facts.

  m@sauron:~ $ echo -e '\tx'
          x


Exactly. The insane thing is to use tab characters to indent code.


This is why I love this particular religious war so much. No matter how absurd it gets, someone can always come along and post something even dumber and more deliberately inflammatory, and without any self awareness at all.


Strange that you can see it is deliberately inflammatory but not self-aware/tongue-in-cheek.


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.


tab width can be any size you want, it's just many text rendering systems default to 8.

Personally I prefer 4 chars. In my opinion it looks tidier when reading back source code.


I don't habe my copy of "Code Complete" here, but AFAICR it cites a study that says code comprehension is best at 3-4 charakter indent.

So, yes, a tab size of 8 is insane...


It's the only correct one. But it should have nothing to do with indent size.




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

Search: