w**z 发帖数: 8232 | 1 Yep, Google's got standards when it comes to Java coding, and they've been
carefully documented for your enlightenment. While these enforceable coding
conventions are clearly most relevant to Java developers interested in
joining the Googleplex, they're also a good indicator of what you might
expect to see in other shops. InfoQ's Bienvenido David lists some of the
rules gleaned from the Google Java Style guide:
No wildcard imports.
Overloads appear sequentially.
Braces are used even when the body is empty or contains a single statement.
Two space indentation.
Column limit can be 80 or 100 characters.
No C-style array declarations.
Default statements required in switch statements.
Modifiers appear in the order recommended by the Java Language Specification.
Constants use CONSTANT_CASE. Note that every constant is a static final
field, but not all static final fields are constants.
Read more on InfoQ and check out the Google Java Style guide ...
http://www.javaworld.com/article/2102551/java-language/googles- |
z***s 发帖数: 3241 | 2 为啥两格缩进?难道不是tab更常见?
coding
【在 w**z 的大作中提到】 : Yep, Google's got standards when it comes to Java coding, and they've been : carefully documented for your enlightenment. While these enforceable coding : conventions are clearly most relevant to Java developers interested in : joining the Googleplex, they're also a good indicator of what you might : expect to see in other shops. InfoQ's Bienvenido David lists some of the : rules gleaned from the Google Java Style guide: : No wildcard imports. : Overloads appear sequentially. : Braces are used even when the body is empty or contains a single statement. : Two space indentation.
|
b*******s 发帖数: 5216 | 3 两格缩进适合写包含很多长变量名的句子
【在 z***s 的大作中提到】 : 为啥两格缩进?难道不是tab更常见? : : coding
|
g*****g 发帖数: 34805 | 4 4 space is the convention from Sun. But I can understand why 2 spaces are
preferred.
100 column is a little low with today's big screen, I think 120 is more
efficient. |
w**z 发帖数: 8232 | 5 my coworker complained when I used Eclipse default 80
【在 g*****g 的大作中提到】 : 4 space is the convention from Sun. But I can understand why 2 spaces are : preferred. : 100 column is a little low with today's big screen, I think 120 is more : efficient.
|
w**z 发帖数: 8232 | 6 that is the battle neither side will give up :)
【在 z***s 的大作中提到】 : 为啥两格缩进?难道不是tab更常见? : : coding
|
z***s 发帖数: 3241 | |
j*****8 发帖数: 3635 | 8 以后面狗家写java的话是不是得按这个标准来了。。
coding
【在 w**z 的大作中提到】 : Yep, Google's got standards when it comes to Java coding, and they've been : carefully documented for your enlightenment. While these enforceable coding : conventions are clearly most relevant to Java developers interested in : joining the Googleplex, they're also a good indicator of what you might : expect to see in other shops. InfoQ's Bienvenido David lists some of the : rules gleaned from the Google Java Style guide: : No wildcard imports. : Overloads appear sequentially. : Braces are used even when the body is empty or contains a single statement. : Two space indentation.
|
g*****g 发帖数: 34805 | 9 这种标准都是formatter + findbug就可以强制了。其实不难实行。 |
w**z 发帖数: 8232 | 10 Yep, Google's got standards when it comes to Java coding, and they've been
carefully documented for your enlightenment. While these enforceable coding
conventions are clearly most relevant to Java developers interested in
joining the Googleplex, they're also a good indicator of what you might
expect to see in other shops. InfoQ's Bienvenido David lists some of the
rules gleaned from the Google Java Style guide:
No wildcard imports.
Overloads appear sequentially.
Braces are used even when the body is empty or contains a single statement.
Two space indentation.
Column limit can be 80 or 100 characters.
No C-style array declarations.
Default statements required in switch statements.
Modifiers appear in the order recommended by the Java Language Specification.
Constants use CONSTANT_CASE. Note that every constant is a static final
field, but not all static final fields are constants.
Read more on InfoQ and check out the Google Java Style guide ...
http://www.javaworld.com/article/2102551/java-language/googles- |
|
|
z***s 发帖数: 3241 | 11 为啥两格缩进?难道不是tab更常见?
coding
【在 w**z 的大作中提到】 : Yep, Google's got standards when it comes to Java coding, and they've been : carefully documented for your enlightenment. While these enforceable coding : conventions are clearly most relevant to Java developers interested in : joining the Googleplex, they're also a good indicator of what you might : expect to see in other shops. InfoQ's Bienvenido David lists some of the : rules gleaned from the Google Java Style guide: : No wildcard imports. : Overloads appear sequentially. : Braces are used even when the body is empty or contains a single statement. : Two space indentation.
|
b*******s 发帖数: 5216 | 12 两格缩进适合写包含很多长变量名的句子
【在 z***s 的大作中提到】 : 为啥两格缩进?难道不是tab更常见? : : coding
|
g*****g 发帖数: 34805 | 13 4 space is the convention from Sun. But I can understand why 2 spaces are
preferred.
100 column is a little low with today's big screen, I think 120 is more
efficient. |
w**z 发帖数: 8232 | 14 my coworker complained when I used Eclipse default 80
【在 g*****g 的大作中提到】 : 4 space is the convention from Sun. But I can understand why 2 spaces are : preferred. : 100 column is a little low with today's big screen, I think 120 is more : efficient.
|
w**z 发帖数: 8232 | 15 that is the battle neither side will give up :)
【在 z***s 的大作中提到】 : 为啥两格缩进?难道不是tab更常见? : : coding
|
z***s 发帖数: 3241 | |
j*****8 发帖数: 3635 | 17 以后面狗家写java的话是不是得按这个标准来了。。
coding
【在 w**z 的大作中提到】 : Yep, Google's got standards when it comes to Java coding, and they've been : carefully documented for your enlightenment. While these enforceable coding : conventions are clearly most relevant to Java developers interested in : joining the Googleplex, they're also a good indicator of what you might : expect to see in other shops. InfoQ's Bienvenido David lists some of the : rules gleaned from the Google Java Style guide: : No wildcard imports. : Overloads appear sequentially. : Braces are used even when the body is empty or contains a single statement. : Two space indentation.
|
g*****g 发帖数: 34805 | 18 这种标准都是formatter + findbug就可以强制了。其实不难实行。 |
t***t 发帖数: 6066 | 19 1. tab is too big, waste of space.
2. tab is interpreted in different editor, so looks good in some editor but
ugly and messed up in other editors.
3. tab and space are visually no diff, so easy to mess up.
【在 w**z 的大作中提到】 : that is the battle neither side will give up :)
|
m********t 发帖数: 13072 | |