由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Google Java coding standard
相关主题
Re: Java Tip: Constantstatic final的问题
final static constants easy get cached?看了zhaoce073大水忍不住说2句
Core Java2 Notes (3)求助,using enum in eclipse
[转载] help please on Javastring pool vs class constant pool问题,在线等
interface可不可以有variable?请教一题
编译原理,正则表示请教Core Java那两本砖头书太浅了
Calendar的日期问题Java banned operator overloading
Eclipse不运行appletoverride/overload/overwrite in Java
相关话题的讨论汇总
话题: java话题: google话题: coding话题: style话题: infoq
进入Java版参与讨论
1 (共1页)
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
7
其实这些东西应该强制 像python一样
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-
相关主题
编译原理,正则表示请教static final的问题
Calendar的日期问题看了zhaoce073大水忍不住说2句
Eclipse不运行applet求助,using enum in eclipse
进入Java版参与讨论
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
16
其实这些东西应该强制 像python一样
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
20
mark
1 (共1页)
进入Java版参与讨论
相关主题
override/overload/overwrite in Javainterface可不可以有variable?
同党们,你们一般看什么websites来了解技术动态编译原理,正则表示请教
netflix的用hdtv看它的电影,如果1000用户同时登录看同一个影片,怎么处理的?Calendar的日期问题
java class definition and implementationEclipse不运行applet
Re: Java Tip: Constantstatic final的问题
final static constants easy get cached?看了zhaoce073大水忍不住说2句
Core Java2 Notes (3)求助,using enum in eclipse
[转载] help please on Javastring pool vs class constant pool问题,在线等
相关话题的讨论汇总
话题: java话题: google话题: coding话题: style话题: infoq