The Source for Java Technology Collaboration


Home | Help | Changes | Index | Search | Go

CodingGuidelines

As most of you who have changed code written by others know, it's very important to have some common coding guidelines.

This page contains information and files about different coding guidelines which are hopefully helpful to you.

Why coding guidelines?

As long as you're just writing programs for your own, personal pleasure, there's no real need to document or stick to coding guidelines other than the ones in your head. However, this changes a lot as soon as you start coding in a team, as most professional developers do. As soon as you have to maintain a class which no comments at all, where all variables are called a, f and z, you wish for coding guidelines and reviews. Been there, done that wink

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” Martin Fowler

Self Commenting Code

Res ipsa loquitur, sed quid in infernos dicit?

Code ownership

There are two schools of thought:
  • Nobody owns the code, anybody can change it
    Extreme Programming tells us that in order to be extreme, anyone can change and refactor any code. This requires unit tests, otherwise it will possibly fail.
  • The code belongs to the author
    This hopefully makes changes quicker, but it only works as long as the author is working for the company.

Existing guidelines

Code Conventions Checkers

  • Checkstyle: Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard;
  • PMD: A Java CodeInspector? that can found code conventions problems;
  • Jalopy
  • Findbugs
  • JavaChecker

Configuration files for IDE



Discussion about CodingGuidelines

Topic CodingGuidelines . { Edit | Ref-By | Printable | Diffs r8 < r7 < r6 < r5 < r4 | More }
 XML java.net RSS

Revision r8 - 01 May 2007 - 18:58:41 - Main.rssh
Parents: WebHome