Bob Jamison wrote:
Here are the Gnu standards. I don't believe in following any standard letter-for-letter (I like 'Whitesmith' style), but this is an excellent document for outlining general practices. Although it is for C, I have used this at our shop for C++ and Java:
Much of it is good, however some seems very outdated...
in 5.1
It is important to put the open-brace that starts the body of a C function in column zero, and avoid putting any other open-brace or open-parenthesis or open-bracket in column zero. Several tools look for open-braces in column zero to find the beginnings of C functions. These tools will not work on code not formatted that way.
What are these utilities? I've seen this in there forever. Tools have matured significantly over the past 10 years, so things such as that might have been outdated long ago.
I'd say the same for putting function names in column zero. Of course, C++ will help make that more of a moot point.
In general, most good programmers I've worked with agree that formatting code for the sake of a tool is bad, and that formatting it for programmer legibility is much more important. "Clarity" is the key
* Don't like the keyword-indent-brace-indent double indention. * Breaking... good * extra parens... good * Formfeed... outdated?
Indenting 8 is just not helpful, and studies have shown that.
In general, jump on in the Wiki and participate. :-D