javatabscoding-style

Are there any widespread, modern Java coding conventions?


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?

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 its own style guide, with slight differences between each one.


Solution

  • The question doesn't ask what your coding style is, but rather for existing coding standards.

    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.