3 ms·
Well, as always, it is more nuanced. If you are simply indenting code, tabs are certainly the semantically correct way, one level of identation, one tab. But so
by danbruc 7y ago
Well, as always, it is more nuanced. If you are simply indenting code, tabs are certainly the semantically correct way, one level of identation, one tab. But sometimes indentation by one level just doesn't cut, sometimes you want finer control for aligning things, for example to highlight common structures in expressions that just differ by some varaibles with unequal lengths. And this is where using tabs and mixing them with spaces falls apart and it fall apart in a spot where you think it is important to have good alignment in order to make the code easier to understand and modify in order to avoid bugs.
- deleted 7y ago[deleted]
- dTal 7y agoI don't see the issue. You shouldn't need to align things with spaces at the beginning of lines, since they're already aligned. And you shouldn't be using tabs for alignment anywhere else in the line; they're indents. So where's the "mixing"? Tabs until the first non-whitespace character on a line, spaces anywhere else you like.
- danbruc 7y agoThe mixing usually happens by accident, you copy and paste bits and pieces, you need a lot of spaces for aligning things and just hit tab, you want to break the indentation rules by a space or two for readability, ... I am not saying that it can not work if you are careful enough, proabably with visible whitespace on all the time, in practice however it will become messy most of the time, especially as people working on a code base come and go.