Oracle Java 代码约定
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22961733/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle Java code conventions
提问by X-HuMan
Does someone know where I can find the document by Oracle which describes Java code conventions?
有人知道我在哪里可以找到 Oracle 描述 Java 代码约定的文档吗?
This URL is not available anymore, for that reason I created new question for this topic.
此 URL 不再可用,因此我为此主题创建了新问题。
采纳答案by eis
One option is to use wayback machine, which seems to contain the document(here's direct link to pdf version). However I would also be interested to find out what Oracle did with it and do they intend to get rid of it.
一种选择是使用回车机,它似乎包含文档(这里是 pdf 版本的直接链接)。但是,我也有兴趣了解 Oracle 对它做了什么以及他们是否打算摆脱它。
There's a discussion on Oracle forumsabout this being raised to OTN support, but no response is mentioned.
有一个在Oracle论坛上讨论这个被提升到OTN支持,但没有任何反应被提及。
Update on 17.6.2014: There's now a forum postingadded to the site explaining the following:
2014 年 6 月 17 日更新:现在网站上添加了一个论坛帖子,解释了以下内容:
Those Java Code Conventions were written in 1999 and have not been maintained since.
The information might not be up to date; links within the documents might not work. That is why the pages were removed. Unfortunately there are other sites that point to that document which were not updated.
To avoid confusions we have re-posted the original document –with an appropriate disclaimer about the information not being up to date- while we clean up those other sites.
这些 Java 代码约定是在 1999 年编写的,从那以后就没有得到维护。
信息可能不是最新的;文档中的链接可能不起作用。这就是页面被删除的原因。不幸的是,还有其他站点指向该文档但未更新。
为避免混淆,我们在清理其他网站的同时重新发布了原始文档 - 并适当声明了信息不是最新的。
And indeed, seems the page has been restored.
事实上,似乎页面已经恢复。
回答by user3919199
The document could be found at: http://www.oracle.com/technetwork/java/codeconventions-150003.pdf
该文档可以在以下位置找到:http: //www.oracle.com/technetwork/java/codeconventions-150003.pdf
回答by Andy
I think that document is dated. SEI has published the latest standards- cool and really good.
我认为该文件已过时。SEI 发布了最新的标准——很酷而且非常好。
回答by Alexandre Cartapanis
The old document seems to be available as HTML too http://www.oracle.com/technetwork/java/codeconvtoc-136057.html
旧文档似乎也可以作为 HTML 使用http://www.oracle.com/technetwork/java/codeconvtoc-136057.html
回答by Ivan Proskuryakov
The required basis is here:
所需的基础在这里:
Google:
谷歌:
Oracle:
甲骨文:
Spring:
春天:
- https://github.com/spring-projects/spring-framework/wiki/Code-Style
- https://github.com/47deg/coding-guidelines/tree/master/java/spring
- https://github.com/spring-projects/spring-framework/wiki/Code-Style
- https://github.com/47deg/coding-guidelines/tree/master/java/spring
More advanced stuff, related to logical structures in the book on page https://martinfowler.com/eaaCatalog/and the book "Clean Code"
更高级的东西,与页面https://martinfowler.com/eaaCatalog/和“清洁代码”一书中的逻辑结构相关