4 ms·
If you use spaces instead of tabs, you're never relying on a particular editor or pager to have tab width set correctly. Tabs aren't just used at the beginning
by camccann 17y ago
If you use spaces instead of tabs, you're never relying on a particular editor or pager to have tab width set correctly.
Tabs aren't just used at the beginning of lines. There might be a left-aligned, multi-line comment to the right of a block of code(...)
I cannot fathom what point he thinks he's making with these. If you're using tabs in a way that depends on tab width, you're doing it wrong.
Tab indentation generally means that one tab character is one layer of indenting. That's it. It's about semantic structure, not layout.
If you want to make ASCII art, or align things like paragraph-style comments, or "indent" things that aren't part of a block of code like pieces of a lengthy conditional clause split over multiple lines, use spaces instead (and then the five people who use proportional fonts will complain that using spaces for alignment "isn't portable"). Of course, if you're using a language with an off-side rule for syntactic whitespace even a die-hard tabber ought to just use spaces.
Personally, I dislike that sort of non-semantic formatting business in source code (and I think off-side rules in syntax are a horrible idea), but that's a matter of taste. And obviously, consistency is vastly more important than the particulars of indenting style. But I get tired of people arguing against tabs on the basis of not knowing how to use them properly.
On the other hand, this unintentionally makes a different, very strong argument in favor of using spaces: people can't manage to use tabs properly, so don't let them. This is why we can't have nice things, folks!