Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 3.34 KB

style_guide.md

File metadata and controls

82 lines (65 loc) · 3.34 KB

This file is an addition to Google's Java Style Guide which you can view here. All the text underneath are only the points in which the styling of this project differs from Google's Style Guide.

2.3.1 (original):
Tab characters may be used for indentation.

3 (original):
This project uses The Unlicense license, therefor no license or copyright information at the top.

3.3.1 (original):
Wildcard imports, static or otherwise, may be used.

3.3.3 (original):
The import statements do not have to be in ASCII sort order, but import statements starting with the same main package name should be grouped.

4.1.1 (original):
Braces aren't used when they are a) optional and b) only one statement follows. This is correct:

if (statement)
  method();

while this isn't:

for (statement)
  if (statement)
    method();

this should be:

for (statement) {
  if (statement)
    method();
}

4.1.3 (original):
An empty block is immediately opened and closed on the same line as the block construct. This is correct:

void doNothing() {}

while this isn't:

void doNothingElse() {
}

4.2 (original):
Indentation uses 4 spaces or one tab.

4.4 (original):
The column limit is 120 characters.

4.6.2 (original):
Point 8: Only the first one is correct, the second one isn't:

//correct
new int[] {5, 6}

//incorrect
new int[] { 5, 6 }

4.8.1 (original):
Constants should always be on separate lines and should never be like an array initializer.

4.8.2.1 (original):
Multiple variable declarations in one line are allowed.

4.8.3.1 (original):
An array initializer should never be in a matrix like grid. Either all one the same line, or all on separate ones.

4.8.4.2 (original):
Fall through shouldn't be commented.

4.8.5 (original):
Annotations should always be above the member class/method/field and there should always be one per line.

5.2.4 (original):
Constants are either enum values or fields marked with static and final.

7.1.1 (original):
A Javadoc should never be on one line. You should always use the first example.