Java development specifications chapter of the basics - typesetting specifications

Online there are many popular development norms, Alibaba, Huawei's development specifications and so on, often seen as the most comfortable is best for them!

Simple summary of what ever their own coding style specification in project development:

1, block indentation style to be used to write, the number of spaces to indent 4 Ge.

2, delimiters (e.g., braces '{' and '}') each on its own line and should be in the same column, while statements that reference them aligned with the left. In the beginning of the function body, and the class interface definition, and if, for, do, while, switch, case statement must procedure as above using indentation.

 

 

 3, the longer statements, expressions or parameters ( > 80 characters) to be written into a plurality of rows, a new row is divided to long expression in the low priority operator, the new operator in the first line, the new divided to properly indented line, so that the layout neat, readable statements.

 

 

 4, a plurality of short statements on one line, that line of writing only one statement

 

 

5, if, for, do, while, case, switch, default and other statements line by itself, and if, for, do, while executing the statement and other statements no matter how much will be added in brackets {} .

 

 

 6, between the independent blocks, after the blank lines must be added to variable declaration.

 

 

 

Guess you like

Origin www.cnblogs.com/cokeHuan/p/11897353.html