4 ms·
The reason is probably similar to why there's now top posting in emails. The support in editors is abysmal and doesn't work out of the box correctly for tabs (
by bhaak 10y ago
The reason is probably similar to why there's now top posting in emails.
The support in editors is abysmal and doesn't work out of the box correctly for tabs (e.g. invisible whitespace).
I've never seen an argument for spaces that would hold iff all editors would have sane defaults for programmers. Of course, it's also bad that some programmers can't configure their tools correctly, but that is a complete different issue.
The best of both worlds would be "tabs for indentation, spaces for alignment" but as it is now, you only need one programmer with wrong settings to screw that up, so that's why most projects have settled on the most conservative setting.
- Stratoscope 10y agoThere's an even more conservative setting, which is "don't use alignment at all, use indentation only." If you do that, all of these issues go away. You can use tabs or spaces for indentation, and it won't affect your formatting. You can reformat the code to a different number of spaces, or switch from spaces to tabs or vice versa, and your code will still be perfectly formatted. A good way to learn and practice this style is to switch your editor to a proportional font. Now you won't be able to use column alignment, and without even working at it you'll naturally start to explore an alignment-free style. I've had many programmers react in shock when they see I write code in a proportional font, but when you don't use alignment it stops mattering what font you use.