What Java Programming Guidelines you are using? I know that the most common is the one provided by Sun (http://java.sun.com/docs/codeconv/) but I would like to know if there are other market standards.
2 good references:
- Joshua Bloch's Effective Java
- Elements of Java Style
As @Bill mentions Checkstyle / PMD / Findbugs can be used for automated checking.
I use those that you linked to as a starting point. One pointer that I can give you is to configure a tool like Checkstyle or PMD to help you conform to whatever standard you settle on.
Im currently tutoring a Java Class and we're using some free Java Videos and we are using the book Head Start Java , which even i as an experienced programmer find fun and interesting. It has a very cool and good perspective.
Since the human brain has only 2 was of remembering things, either by "force", this meaning that you need to repeate untill you understand. Or by reference, meaning that if you see a nice Object and you can assosiate this with a image or something that happend, you will remember.
Head start java uses a lot of good explaining images and is a good Guideline to become a generally good programmer.
I've been programming in Java since it came out and have never worked with a group that found conventions to be necessary. The biggest debates seem to be if you should use this. for member variables and which line to put opening braces on.
I just tend to pick up whatever styles my current project uses and go with it. Getting emotional or instant about it is a complete waste of time.
However, readable code is critical. It's assumed that you will have sufficient whitespace and javadocs on public methods for the most part. It's just that brace alignment doesn't really effect readability as much as some people with Anal Brace Alignment Stress Syndrome would like you to believe.
I've noticed most Java code actually follows the guidelines set by Sun. What's interesting is I bet most people didn't even know there were such guidelines, yet they were already following them.
This is a case of monkey see, monkey do, which is a good thing. This has allowed Java code to be far more readable than other languages which have a lot more history.
Why are you even looking for another guideline?
Its become the de facto standard. Use it.
I use a set of standards I've published here:
http://www.softwaremonkey.org/Article/CodingStandards
and I use the less common banner indentation standard:
As well as seconding toolkit's recommendations of Effective Java and Elements of Java Style a new book which I feel communicates the concept of style (and more importantly craftsmanship) very effectively is Robert Martin's "Clean Code: A Handbook of Agile Software Craftsmanship"
This focuses not so much on whether there is a space before each '{' but on what are the real differences between good code and bad code.
http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882
Get it, read it, absorb it and then pass it on to your team.
I use this:
http://satukubik.com/2010/01/06/my-eclipse-code-formatter/
You can get the Eclipse formatter definition from GitHub.