3 ms·
While I agree with you personally, I could see the counterargument of: A tab is always a tab, and I can tweak my IDE to render a tab as however many spaces I li
by tedmiston 7y ago
While I agree with you personally, I could see the counterargument of: A tab is always a tab, and I can tweak my IDE to render a tab as however many spaces I like (2, 4, 8, etc) without changing the code.
- qes 7y ago> I can tweak my IDE to render a tab as however many spaces I like Sure, IDE's are easy (though many people use multiple IDE's and/or editors across multiple machines). I've also got a couple diff tools, a few VCS's, also the online parts of VCS like web-based pull request review UI's. Tabs also tend not to play as nice with vertically aligned elements, if you prefer that for things like say the '.' on multi-line chained method calls, or longer function parameter lists.
- funkymike 7y agoI'm a tabs for indentation, spaces for alignment person myself. A multi-line statement should have the same number of tabs on each line. Any line after the first should then have spaces as needed. I'll work without complaint or changing it with any existing code whether spaces or tabs. Mix the two for indentation however and fixing it is the first commit I make before touching anything else.
- dvt 7y agoIn a lot of cases though, you can't change what a tab is (consider looking at code on GitHub).
- tedmiston 7y agoThis is a good point. Maybe at some distant point in the future we will softly decouple formatting from code by delegating it all to finely tuned autoformatters, or totally decouple it by storing code in a slightly more abstract form such that whitespace rendering becomes largely a presentation preference.
- ChrisSD 7y agoYou can on Github but it requires using `?ts=4` in the url or committing an editorconfig file. Perhaps there are extensions that do it automatically.