有没有广泛的,现代的Java编码约定? [英] Are there any widespread, modern Java coding conventions?

查看:143
本文介绍了有没有广泛的,现代的Java编码约定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sun的 Java编程语言的代码约定最后更新于1999年4月。十年后,语言和通用使用模式发生了很大变化。是否有更新的,广泛采用的标准?

Sun's "Code Conventions for the Java Programming Language" was last updated April 1999. Ten years later a lot has changed in the language, as well as general usage patterns. Are there more up to date, widely adopted standards?

大多数指南都省略指定文件编码和行尾。 Sun建议混合制表符和空格。 Eclipse IDE默认为Eclipse的标准,仅仅是选项卡。 Maven风格指南只是空格。许多样式指南(例如 JBoss )遵循Sun的指南,但更喜欢使用K& R大括号,而不是 OTBS 。每个Apache项目都有它自己的风格指南,每一个之间有微小的差异。

Most guidelines omit specifying file encoding and line endings. Sun recommends mixed tabs and spaces. The Eclipse IDE defaults to Eclipse's standard, which is tabs only. The Maven style guide is spaces only. Many style guides, such as JBoss, follow Sun's guidelines, but prefer K&R braces instead of OTBS. Each Apache project has it's own style guide, with slight differences between each one.

推荐答案

问题不问什么你的编码

我发现 欧洲空间局Java编码标准 (pdf)( alt链接),这似乎是最新的和全面的,虽然我不知道如何广泛通过是。

I found the European Space Agency Java Coding Standards (pdf) (alt link) which seems up to date and comprehensive, though I'm not sure how widespread the adoption is.

这篇关于有没有广泛的,现代的Java编码约定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆