Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

Coding conventions for ParaGUI

Coding rules

Coding style

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

astyle --style=kr --indent=tab=4 --indent-switches 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.";
    }
}

Things to notice:



The ParaGUI Project - Alexander Pipelka