forked from mongodb/mongo-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 4
Java Style Guide
erh edited this page Oct 28, 2010
·
11 revisions
- No tabs
- "tab" == 4 spaces
- When relevant, follow mongo server rules: mongo server rules
- eclipse formatting file
- public static at top
- members at bottom
- members should start with _
- members should be package private by default
- do not use this unless absolutely needed
class Foo {
static public final int CONSTANT = 5;
public Foo(){
}
private int _member;
}
void foo(){
if ( true ){
print( "yay" );
}
else if ( true ){
print( "boo" );
}
else {
print( "zzz" );
}
}
Currently code use wildcards. We should not mix and match, so if people want to switch we can vote and switch wholesale