stds
Differences between revisions 1 and 2
|
⇤ ← Revision 1 as of 2009-10-11 17:14:47
Size: 1747
Comment:
|
← Revision 2 as of 2009-10-11 17:39:28 ⇥
Size: 1742
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 82: | Line 82: |
| bar = get_blumpkin( foo ); | bar = getBlumpkin( foo ); |
| Line 88: | Line 88: |
| do_stuff(); open_blotch( foo ); // we blotch the foo |
doStuff(); openBlotch( foo ); // we blotch the foo |
| Line 91: | Line 91: |
| baz_the_bar( foo ); | bazTheBar( foo ); |
Beginners Development Coding Standards
As implemented in C++
- Single line logic statements, with spaces.
if ( foo == bar ) {
...
}- Same goes for Class declarations, or functions. Functions must space as if it was a logic statement.
class foo {
public:
foo() {
...
}
void bar( int arg ) {
...
}
};- Main method should be neat and clean
int main ( int argc, char ** argv ) {
...
}- C++ Example
int main ( int argc, char ** argv ) {
int foo = 0;
int bar = 1;
bool baz = false;
bar = get_blumpkin( foo );
if ( bar == 1 )
frobernate( baz );
if ( baz || bar != 3 ) {
do_stuff();
open_blotch( foo ); // we blotch the foo
} else {
baz_the_bar( foo );
}
/*
* This is a multi line comment
* Line up the lines so it looks nice
* Because this just looks fantastic
*
*/
std::cout << "Well, hey there.\n";
}
As implemented in Java
public class Example {
public static void main(String[] args) {
int foo = 0;
int bar = 1;
boolean baz = false;
bar = getBlumpkin( foo );
if ( bar == 1 )
frobernate( baz );
if ( baz || bar != 3 ) {
doStuff();
openBlotch( foo ); // we blotch the foo
} else {
bazTheBar( foo );
}
/*
* This is a multi line comment
* Line up the lines so it looks nice
* Because this just looks fantastic
*
*/
System.out.println( "Well, hey there." );
}
}BeginnersTeam/FocusGroups/Development/Joining/stds (last edited 2009-10-11 17:39:28 by cpe-76-189-210-251)