Ayyoudy Ayyoudy -3 years ago 143
Java Question

Where can I find the OFFICIAL Java Coding/Style Standards?

I use CheckStyle plugin for Eclipse and it does a wonderful job. I would like to know if there an official Code/Style standard (and there should be!) out there by Sun/Oracle... The ones I am finding are so out-dated, they don't even include any Java 1.6 specific syntax, etc...

Here is what I found so far:

http://developers.sun.com/sunstudio/products/archive/whitepapers/java-style.pdf (last modified 2000)

http://www.oracle.com/technetwork/java/javase/documentation/codeconvtoc-136057.html (last modified 1999 - CheckStyle website references this)

I understand that to a degree most of the Java syntax has not changed much but you'd think it wouldn't be over 10 years old!!! Any ideas where to find an updated version or if there is any that I am just not finding?

Thanks

Answer Source

Try looking at the -Xlint compiler flag for javac for a programmatic check (if that's your question). It checks most things for you.

Also, what's wrong with having a code style document that's > 10 years old? That means the language is fairly stable and older code looks much like newer code, making maintenance easier. The library may have expanded but much of the syntax is identical. Your second link is what my searches returned and seems very comprehensive.

EDIT: If you want the nitty gritty details on the new Java syntax, check out the Java Specifications.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download