> Amen, and Amen. > > More people should adopt the Linux kernel coding standards: > > http://www.adamspiers.org/computing/Linus-Kernel-CodingStyle > > 80 columns max. 8-space tabs. If your code starts looking ugly under > those constraints, you're probably writing bad code. From the doc: > > --- > Now, some people will claim that having 8-character indentations makes > the code move too far to the right, and makes it hard to read on a > 80-character terminal screen. The answer to that is that if you need > more than 3 levels of indentation, you're screwed anyway, and should > fix your program. > ---
I agree with a few of his points, but the whole put curly brackets at the end of the line normally, but at the beginning of the line for functions, kind of ruins his argument for me. It shows me that he's more concerned with doing things how he likes than making them consistent. Maybe that's an unfair criticism, but that's how it reads to me. I've tried doing 4-space, and 2-space tabs, spaces instead of tabs, etc. I think I'm going to go back to tab characters. It makes the file smaller, and whoever reads the code can see it however they want to see it by setting their own tab-stops. I never understood why people are so anal about formatting; I can't recall ever being inhibited in reading someone's code based on how many spaces they use and where they put the brackets. I can see it in cases where someone puts a multiple statements on the same line, leaves out technically unnecessary brackets (like the javascript example posted earlier in the thread), or purposely obfuscates their code, but spacing? Who cares. But that's just my opinion, and I realize that not many will agree. Greg /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
