3 ms·
I was writing a comment about why I think spaces are better, specially with auto-formatting but now... I feel like tabs could be better if you let the auto-for
by emi2k01 3y ago
I was writing a comment about why I think spaces are better, specially with auto-formatting but now...
I feel like tabs could be better if you let the auto-formatter do its job by setting the tab width to 4 spaces. That should be good enough so that people with a tab width of 2 or 8 don't see the code lines neither very short nor very long. I also feel like most people who use spaces are good with a tab width of 4?
I also would not take into account tab widths not in [2, 8].
- Someone 3y ago> if you let the auto-formatter do its job by setting the tab width to 4 spaces. I think the autoformatter should use typewriter tabs (so that you could have your first tab in column 4, the second in column 30 and a decimal tab in column 40, and, in another code block, tabs at columns 4 and 12, for example) and dynamically adjust the width of each column. It should show the code in the way the viewer can best understand it, picking fonts, colors, indentation and empty lines to their preference. Except for a few esoteric programming languages where spaces are highly significant, that could mean showing hugely different things to different people. Open issue with that is that code reviews could get more difficult (things like “two lines up” might not make sense if you prefer function arguments on separate lines, and I prefer them on a single line)