Re:Developers who use spaces make more money than those who ...
by lloeki on Thursday June 15, 2017 @05:38PM
(#14564605)
Simple: it's hell to automate.
My process is as follows:
- tabs allow for custom settings
- tabs need spaces to allow for alignment, because previous
- automatically deciding what constitutes alignment vs
indent is a non-trivial problem, highly dependent on the
language†
- using spaces throughout is worse theoretically because
it flattens the theoretical problem but solves impedance
mismatch
- therefore I use spaces and am all the merrier in every practical
use case
- except for languages who make dash 3 easy (such as Go thanks
to gofmt)
- except for projects I have no say in, where I respect the will
of the maintainers, because conventions among well-behaved
people matter more than my highly individual opinion.
† to which the usual answer is "but your editor sucks with lang X", well too bad, I'd rather have pragmatic editor portability than have perfect language parsing in every editor being a pipe dream I hinge upon.
Re:Developers who use spaces make more money than those who ...
by Stratoscope on Thursday June 15, 2017 @03:23PM
(#14563573)
It's not that "tabs for indentation, spaces for alignment" is a bad practice, it's that alignment itself is a bad practice. It doesn't help readability, it directly causes overly long lines of code (which pushes people to try to use narrow indentation to compensate), it's something you have to fiddle with every time you refactor a name, and it gives you spurious changes in your VCS diffs. (Yes, you can set any diff program to ignore whitespace changes, but I want to know when whitespace has changed.)
Could you please clarify why do you consider "tabs for indentation, spaces for alignment" such a bad practice? I have never read any argument against it.
Alignment itself can be done automatically by any editor that supports smart tabs.