I have found Sun's Java code conventions which were lastly revised in 1999.
Is it out of date now?
After 26 years of existence — Java is still doing well — programmers who know it are still in high demand. They will continue to be sought after for a long time to come as over 90% of the Fortune 500 companies still rely on Java for their development projects. Globally, there are over 8 million Java developers.
The Java code conventions are defined by Oracle in the coding conventions document. In short, these conventions ask the user to use camel case when defining classes, methods, or variables. Classes start with a capital letter and should be nouns, like CalendarDialogView .
Java is one of the most popular programming languages worldwide. It was created by James Gosling and Patrick Naughton, employees of Sun Microsystems, with support from Bill Joy, co-founder of Sun Microsystems. Sun officially presented the Java language at SunWorld on May 23, 1995.
1) James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. The small team of sun engineers called Green Team. 2) Initially it was designed for small, embedded systems in electronic appliances like set-top boxes.
It's funny to ask this question exactly in the time when the guide is not available for unknown reasons. Perhaps it is being rewritten for Java 8?
Anyway, it's mostly still valid.
There are some controversial points (as in every styleguide) and there are lots of advice missing because of the last revision date (generics, enums, varargs, etc. - don't forget to have some conventions for those, too).
The main point is - you don't have to adhere to it religiously. Read it, let it sink in, try to use as much of it as possible for you and your team. If you find something that doesn't suit you, because you feel it's an outdated opinion, you can simply drop it. The only thing you have to be is consistent. If you start with one style, don't switch to another while still having old code.
By the way, there are many style guides out there. If you want something "new" (but a lot less thorough), see for example the very new Google styleguide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With