Greetings,
So, what sort of coding conventions do people want to adopt? I'm not really a C++ coder so I wont offer up too many suggestions, but I do intend on doing what I can to 'help' developers follow the decided upon conventions by creating Emacs and Vim modelines for the source files...unless someone has a good argument against doing that.
At any rate, the only thing that I think is important is 'no tabs'...anyone care to suggest/discuss/argue-without-starting-a-war other conventions (this would include filename schemes for C++ as mentioned in the booleans thread)?
*g*
-Tom
On Sat, 13 Dec 2003 tvon@...63... wrote:
Greetings,
So, what sort of coding conventions do people want to adopt? I'm not really a C++ coder so I wont offer up too many suggestions, but I do intend on doing what I can to 'help' developers follow the decided upon conventions by creating Emacs and Vim modelines for the source files...unless someone has a good argument against doing that.
At any rate, the only thing that I think is important is 'no tabs'...anyone care to suggest/discuss/argue-without-starting-a-war other conventions (this would include filename schemes for C++ as mentioned in the booleans thread)?
*g*
-Tom
Jon Cruz started a page in Wiki to capture coding conventions, and Mental and Peter have been working on it as well. If you care about such matters please get involved at this point. Within the coming few weeks we expect to have this finalized and formalized.
http://www.inkscape.org/cgi-bin/wiki.pl?Coding_Style
Bryce
Bryce Harrington wrote:
On Sat, 13 Dec 2003 tvon@...63... wrote:
Greetings,
So, what sort of coding conventions do people want to adopt? I'm not really a C++ coder so I wont offer up too many suggestions, but I do intend on doing what I can to 'help' developers follow the decided upon conventions by creating Emacs and Vim modelines for the source files...unless someone has a good argument against doing that.
At any rate, the only thing that I think is important is 'no tabs'...anyone care to suggest/discuss/argue-without-starting-a-war other conventions (this would include filename schemes for C++ as mentioned in the booleans thread)?
*g*
-Tom
Jon Cruz started a page in Wiki to capture coding conventions, and Mental and Peter have been working on it as well. If you care about such matters please get involved at this point. Within the coming few weeks we expect to have this finalized and formalized.
http://www.inkscape.org/cgi-bin/wiki.pl?Coding_Style
Bryce
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:
http://www.gnu.org/prep/standards.html
By the way, I put Saturday's CVS Win32 build at:
http://troi.lincom-asg.com/~rjamison/files/inkscape.zip
Bob Jamison Titan Corp
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
Jon A. Cruz wrote:
- Don't like the keyword-indent-brace-indent double indention.
Yeah, it doesn't bother me, but I prefer to do it Whitesmith style, so it's more like:
for ( i=0 ; i<x ; i++ ) { code... more code.... while ( TRUE ) { stuff here } more code.... }
This way everything, including braces, is at the same nesting level. You can easily run the cursor up and down the code and find all of the lines at that level.
Again, that's just what I am comfortable with. I am not disagreeable to other people's styles (even K&R, yuck!). One thing the manual says which I agree with:
If someone else has started a file with a certain style, stick with it.
Bob
Bob Jamison wrote:
By the way, I put Saturday's CVS Win32 build at:
It's slightly megalomanic to reply to my own email ;-) .
(or schizo?)
But that directory was getting a bit full, so I have moved all of the files to:
http://troi.lincom-asg.com/~rjamison/inkscape
and that one in particular to:
http://troi.lincom-asg.com/~rjamison/inkscape/inkscape.zip
Sorry if you couldn't find them. This location is more stable.
Bob
participants (4)
-
unknown@example.com
-
Bob Jamison
-
Bryce Harrington
-
Jon A. Cruz