3 ms·
To quote BSD style(9): Indentation is an 8 character tab. If you have to wrap a long statement [because it would go past the 78th column], put the operator at
by cperciva 18y ago
To quote BSD style(9): Indentation is an 8 character tab.
If you have to wrap a long statement [because it would go past the 78th column], put the operator at the end of the line. Second level indents are four spaces. Do not add whitespace at the end of a line, and only use tabs followed by spaces to form the indentation. Do not use more spaces than a tab will produce and do not use spaces in front of tabs.
If you find that your code doesn't fit into 78 columns using 8-character tabs... you need to refactor your code.
If your editor mangles whitespace... get a better editor.
- ScottWhigham 18y agoWhy would someone downvote this? It's the guy/girl's opinion, it's about the topic, and I don't see any reason to downvote other than someone is just having a bad day or being pissy.
- lacker 18y agoA lot of decent code won't fit into 78 columns with 8-character tabs. An if statement inside a for loop inside a function inside a class is already 4 levels of indentation. Call a ten-letter function with three ten-letter arguments and you're over the limit. It depends a lot on the style of code... some apis will have really long names and require a lot of arguments. In this case you'll run over 80 columns even if you use two-space indentation (which we do at my workplace).