You can change your editor's behaviour regarding tabs to different modes:
1. The "tabstop" mode. This is where every "tab" will move the following text to the next "tabstop". Its the original way the tab key has been invented for, back then still on typewriters, and the linux code style guidelines are designed for tabstops that are configured for 8 spaces exactly.
The problem with tabstops on the right is, that the spacing may be completely uncertain.
So, in the best case, tabstops can help you with alignment:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
int __temp = (x);*TB*\
other(__temp);*TAB*\
but what happens with this example:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
int __temp = somelongfunctionname(x);*TB*\
other(__temp);*TAB**TAB**TAB*TAB*TAB*TAB*\
you will have to use multiple tabs on the second line! Thats even worse than using spaces, because you'll never be certain how much tabs to use. Imagine if you watch the same file, just with another number of spaces configured to tabs:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
int __temp = somelongfunctionname(x);*TB*\
other(__temp);*TAB..**TAB..**TAB..*TAB..*TAB..*TAB..*\
So, tabbing style is broken here.
Elastic tabstops would help against this, but we shouldn't introduce completely new concepts.
2. The "constant space" mode. In here every tab character is associated a fixed number of characters.
I think, tab usage should be portable across all configurations, whether its "tabstops" or "constant spaces" (and both feature countless submodes). My proposal would even support "typewriter style" tabstops, that can be set manually (like in word): 1 cm for the first tab level, 1.5 for the second, and 2.7 for the 3rd.
Tabs give flexibility. We shouldn't take it away again. Moving those "ugly" characters doesn't *re*move them, they even create more problems.
Its a dead end if we want to align tab level differences on the left with spaces on the right.
The \ character is similar to the ; character, you don't align to that either. Yes, it looks different at first glance, but I'm sure you get accustomed to it.