-
Notifications
You must be signed in to change notification settings - Fork 114
Coding Guidelines
Razorax edited this page May 19, 2016
·
3 revisions
The following coding guidelines must be followed for any contributions to uSkyBlock.
- Whitespace: Always use spaces, not tabs (tab-stops/indentation may wary from IDE to IDE, spaces wont)
- Scopes: Always use curly-braces in
if-then-else
or similar constructs. - Curly-braces: Belong to the line of the keyword, not on a separate line. We want lines to carry meaning, a curly carries no meaning on it's own.
- Naming: Use the Java-naming-conventions, not the C# ones, meaning
** CAPITALS: Denote constants (
static final
orenum
). ** UpperCamelCase: Denote classes (never variables) ** lowerCamelCase: Denote variables, fields or methods. All IDEs can distinguish between the three, and methods will always have paranthesis at the end.
public class MyClass {
String myField;
public MyClass() {
}
public myMethodWithCamelCase(String myArg) {
boolean myVariable = true;
if (myVariable) {
doSomething();
} else {
doSomethingElse();
myVariable = false; // Any decent IDE will color this assignment different
myField = "Something"; // From this one, so no need for this.myField or _myField or m_myField.
}
}
}