The problem with tabs is that they render as different widths in different contexts. For example, Visual Studio shows them as 5 spaces, but Github shows them as 8.
Puts me firmly in the spaces camp now.
The problem with tabs is that they render as different widths in different contexts. For example, Visual Studio shows them as 5 spaces, but Github shows them as 8.
Puts me firmly in the spaces camp now.
The funny thing is that this is why I prefer them. It means I control how indents render rather than the person who wrote the code.
Nowadays I just chuck format on save on all the code I deal with so I don't have to deal with any of this stuff anymore.
If we take this to its longer conclusion though, it would be pretty good if our tooling supporting a difference between the view (using your own preferences) and storage (consistent code for committing to git or whatever).
1. Change the tab width in your IDE 2. Turn on line-wrapping
I'm in the spaces camp, but I was musing about this for the tabs camp because wanting to adjust the indentation seems reasonable.
(My "favourite" convention was Luajit where the convention was: 2 spaces, until we got to 8 spaces, in which case tab.)
The problem is that everyone touching the project can and often does have different defaults. If you work on a professional setting, specially in legacy projects, you are bound to touch files where your changes comprise mainly of whitespace changes.
People who don't understand tabs are akin to those who don't understand styles: Doomed to laboriously dick around with formatting, and make work for everyone else.
I mean, "just use the IDE's default" isn't really agreeing, unless that's what your entire organization does too, and you all use the same IDE :)
FWIW, none of the places where I've worked has everyone used the same IDE (or an IDE at all, personally I use nvim so :shrug: ). Fun how the world is different for everyone :)