3 ms·
My pet theory is that the preference for spaces comes from people who want their codebase to be equivalently readable in any editor right off the bat. With tabs
by strogonoff 5y ago
My pet theory is that the preference for spaces comes from people who want their codebase to be equivalently readable in any editor right off the bat. With tabs, depending on editor configuration, the same codebase could look fine on one machine and be a mess on another.
Furthermore, I believe that with certain indentation styles (e.g., when arguments in a function call align with the opening paren) tabs require that one extra preliminary step of configuring one’s editor in order to view the code properly, while with spaces that extra step has more optionality and is only needed in order to edit the code with auto-indent.
IMO since one has to adapt their coding style to the dominant style of the codebase (single/double quotes, etc.) either way, one might as well adapt to the indentation as well, so I’m not against spaces.
And of course, due to people who don’t take care to set up their tooling and end up mixing tabs and spaces for indentation, a particularly hot mess can arise—and what’s worse, that mess can accidentally look fine in editors that happen to be configured in a particular way. Because of that, I keep whitespace visibility turned on across my editors.
- srl 5y agoYour first point is closely linked to a theory raised in a past thread (https://news.ycombinator.com/item?id=20719010 https://news.ycombinator.com/item?id=20719010). Large, well paying companies tend to require everyone to use spaces, for pretty much exactly the reason you mentioned.