3 ms·
That's the problem, though. People do that, and then to indent 12 spaces, your guy who uses 4-space tabs will put three tabs, your girl who uses 8-space tabs wi
by taneq 9y ago
That's the problem, though. People do that, and then to indent 12 spaces, your guy who uses 4-space tabs will put three tabs, your girl who uses 8-space tabs will put a tab and four spaces, and your ace who uses only spaces will put twelve spaces. And after a year of sharing code doing this, your formatting will be farked and you'll spend half your time fixing other peoples' "broken" indentation.
I have no issue whatsoever with using tabs in an editor, as long as it saves them as spaces on disk.
- iforgotpassword 9y agoYou do not "indent 12 spaces", you have levels of indentation. If you indent code only using tabs it doesn't matter whether you set your tab width to 4, 8 or 20, it will always display properly. Feel free to change your tab width hourly, still no problem. The only valid argument is that mixing spaces and tabs for indentation messes things up, but that argument works both ways so doesn't support either side in this never ending argument.
- esrauch 9y agoIt is trivial both to ban tabs and to bulk convert tabs to spaces in a codebase or presubmit hook. The other direction seems impossible. That means that if you want to avoid a mixed codebase it is far easier to get to and stay at spaces only than tabs-for-indent, spaces-for-alignment.
- deleted 9y ago[deleted]
- taneq 9y agoStill messes with alignment if you want to do things like keep your comments aligned at the right of the page.
- tinus_hn 9y agoThe solution is to have the repository refuse checkins with bad indentation. Anyone who can program can follow indentation rules, many people just can’t be bothered. But they can if there is no alternative.