You might have heard that really good written code doesn't need commenting. Maybe that's a bit exaggerated but in some sense true. If all variables, methods, classes and so on are named after specific conventions they will be more readable to you and other programmers that might inherit your code some day.
Take a look at the conventions for coding and commenting here:
- Code conventions for the Java Programming Language
- Java Programming Style Guidelines (another format of the above)
- How to write doc comments for the JavaDoc Tool
Technorati tags:
Java, Code convention, JavaDoc, naming, Programming Style Guidelines
Try Checkstyle, http://checkstyle.sourceforge.net/, it validates that the sourcecode is in the correct format. There is also a great Eclipse plugin at http://eclipse-cs.sourceforge.net/. It's highly configurable, and a great tool to get nice-looking code!
ReplyDeleteHi Johan,
ReplyDeleteThanx a lot for that. I just tried the eclipse plug-un and it works great, just what I wanted. It feels like I should configure some myself though since it seems to complain on every tab character (indent) I have on every line. Maybe that is good java programming but it seems hard for me to read.
This comment has been removed by the author.
ReplyDeleteI bumped into Mobilefish.com who provides a configuration file for checkstyle which is less extreme and takes away some of most annoying checkstyle warning messages. Works perfect for me. Take a look at it here ->
ReplyDeletehttp://www.mobilefish.com/developer/checkstyle _
/checkstyle_quickguide_configuration_file.html