4 ms·
>Why do different tab settings result in inconsistent formatting? Because some programmers also use tabs for cosmetic alignment. (The other thread also illus
by jasode 7y ago
>Why do different tab settings result in inconsistent formatting?
Because some programmers also use tabs for cosmetic alignment. (The other thread also illustrates some examples.) It doesn't matter if that's semantically incorrect. A lot of it has to do with muscle memory; the programmer's brain is on automatic pilot and therefore the left pinky finger just taps <tab><tab> ... to line up function parameters or the values of variables. This type of alignment is not always round-trip perfectly preserved with code formatting utilities that covert tabs->spaces->tabs.
(In other words, some programmers sometimes presses <tab> not for its semantic meaning but as a mechanical shortcut to quickly move the cursor to the right an arbitrary amount.)
One can make an airtight case for the rational purity of tabs but the problem is that the real world doesn't always want to cooperate.
- scrollaway 7y agoIn the real world, there's people who benefit from the accessibility of tabs. It's not that hard to avoid alignment (which most devs recommend against for other reasons such as maintenance costs and git diff noise), I've been doing so for fifteen years without issues.