-
Notifications
You must be signed in to change notification settings - Fork 75
Java Coding Conventions
Zuozhi Wang edited this page Mar 28, 2017
·
8 revisions
Author: Zuozhi Wang
This document specifies the coding conventions in TextDB project.
-
Use spaces instead of tabs. Configure your IDE or text editor to use 4 spaces instead of tabs.
In Eclipse
In IntelliJ, uncheckuse tab character
. -
Use camel case, e.g.
SampleClass
,sampleVariable
For constants, use all upper case with underscores, e.g.SAMPLE_CONSTANT
-
Use the following indentation style
/**
* Don't forget to write JavaDoc comments.
*/
public void sampleFunction(int x) {
// leave one space before bracket {
if (x > 0) {
doSomething();
} else {
doSomethingElse();
}
}