-
Notifications
You must be signed in to change notification settings - Fork 773
Coding Style
Josh Klontz edited this page Jul 3, 2014
·
14 revisions
The most important rule is that new code should be consistent with the existing code around it. The rules below illustrate the preferred style when cleaning up existing inconsistently-styled code.
These rules are a work in progress and are subject to additions and (less likely) changes.
struct FooBar
{
};
int *fooBar(const int &x, int *y, int z)
{
*y = x + z;
return y;
}
for (int i=start; i<end; i++)
foo();
for (int i=start; i<end; i++) {
foo();
bar();
}
Use const
whenever possible.