Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

Coding conventions for ParaGUI

The Easy Route

Grab astyle, a code formatter for C, C++, and Java, from http://astyle.sourceforge.net. All code in the repository should be run through astyle before being committed, with these options:

astyle --style=kr --indent=tab <filename>

Or, to make life easy, you can put this file in ~/.astylerc and just run:

astyle <filename>

Doing this has several advantages:

Note: don't make a habit of formatting all source files ("just to be sure") instead of just the ones you modified. This will update the timestamps on the files and cause all hell to break loose.

Here's an outline of the code format, for the sake of completeness.. but use astyle. Please. :)

Sample code:

// No, this code is not supposed to make sense
void foo(int bar) {
	if (bar < 7) {
		cout << bar << endl;
	}
	else {
		cout << "That's a big bar you got there.\n"
	}
}

Things to notice: