3 ms·
Code with tabs inevitably ends up with X spaces where a tab should be, which goes unnoticed until viewed with a different tab width.
by edflsafoiewq 2y ago
Code with tabs inevitably ends up with X spaces where a tab should be, which goes unnoticed until viewed with a different tab width.
- fire_lake 2y agoCould easily be fixed with CI
- poincaredisk 2y agoJust like incorrect indentation using spaces. I personally use autoformatter in all CI pipelines, and error out for every change. This entirely kills the whole issue of wrong indentation/dangling spaces/accidental tabs/inconsistent formatting, etc.
- thomassmith65 2y agoThat's a valid point, though I think it's evitable (if that's a word) because many editors have visible white space, and it's easier for the eye to catch 4 dots after a long tab than to notice that an indentation is 7 dots instead of 8, etc. It also attracts more attention when using arrow keys to navigate the offending lines.
- samatman 2y agoBingo. And the only solution to this problem, consistent use of a formatter, solves the equivalent problem with spaced indentation just as well. I would prefer to have the spacing version of this problem, personally, because that way I can always see that there's a problem, and can do so without resorting to changing tab widths or making invisible characters visible.
- thomassmith65 2y agoYou also make a good point. I usually code in Sublime, where I have invisible characters hidden in unselected text. At this point, I am used to doing 'select all' to check whitespace, but I can understand how that could annoy.