3 ms·
Tabs should never be used for lining things up, for that very reason. In your example, you've stopped 'indenting' and started 'aligning'. And it's only 'working
by oneeyedpigeon 11y ago
Tabs should never be used for lining things up, for that very reason. In your example, you've stopped 'indenting' and started 'aligning'. And it's only 'working' because "var " % 2 == 0; other language keywords will screw that up.
- Zikes 11y agoSounds to me like you're saying there's no objectively correct answer that works for all languages and situations, which I agree with.
- scrollaway 11y agoThere... is, actually. If you don't actually attempt to align the variable names, then what you're doing is "indenting items in a list", essentially. In general, you should avoid aligning unless the readability gains are significant. Aligning things means that you end up re-aligning when you add or remove longer items. This increases maintenance and pollutes diffs (which also means code reviews and git logs).
- jahewson 11y agoMy editor aligns things for me - no effort at all.
- scrollaway 11y agoYou are creating effort for the people who review your code. On their behalf, please stop, it's tedious.