3 ms·
How do you mean 8 space tabs? Are tabs not single characters \t?
by ccmcarey 6y ago
How do you mean 8 space tabs? Are tabs not single characters \t?
- ordu 6y agoYou can customize your text editor to show them as any number of spaces. Mostly people prefer tab-stops at each forth or eighth column.
- dezgeg 6y agoIn practice you get problems, because of the line length rule. I.e. if your editor is configured with four-space tabs and a line with one leading tab shows up in your editor having 79 characters, it will show up as 83 characters for others assuming the normal 8-space tabs thus breaking the line length rule. Not to mention that coding style may require that function calls broken to 2 lines must have the arguments aligned at the opening parenthesis. For example, breaking up foobarbaz(1, 2); into two lines would require having the second line start with <TAB><SPACE><SPACE>2); which would no longer look correct with 4-space tabs.
- eMSF 6y ago>Not to mention that coding style may require that function calls broken to 2 lines must have the arguments aligned at the opening parenthesis. That doesn't result in any problems with using <TAB>s, unless the coding style also requires you to replace all (leading) sequences of N spaces with with a <TAB>, which is, IMO, quite brain-dead. For example, if (cond) { <TAB>foo(1, <TAB><SP><SP><SP><SP>2); } looks fine regardless of the width of <TAB>. Admittedly, your first problem remains; a problem with dumb editors. In truth, your editor could well signal if your lines exceed the limit (indent-width*indent + rest) you have set for your project, just as easily as it can draw a line at a column. The harder problem is that you need a context-aware editor for it to help you with indenting. Most editors are incapable of that by default.
- dezgeg 6y ago> unless the coding style also requires you to replace all (leading) sequences of N spaces with with a <TAB>, which is, IMO, quite brain-dead It is brain-dead, but that is exactly what is required in many styles.