Java Code Conventions
This Code Conventions for the Java Programming Language document contains the standard conventions that Sun follow and recommend that others follow. It covers filenames, file organization, indentation, comments, declarations, statements, white space, naming conventions, programming practices and includes a code example. Why have code conventions? Code conventions are important to programmers for a number of reasons:
- 80% of the lifetime cost of a piece of software goes to maintenance.
- Hardly any software is maintained for its whole life by the original author.
- Code conventions improve the readability of the software, allowing engineers to understand new code more quickly and thoroughly.
- If you ship your source code as a product, you need to make sure it is a well packaged and clean as any other product you create.
The Code Conventions for the Java Programming Language document was revised and updated on April 20, 1999.
Direct Download Links:
Why is documentation in code important?
How many times have we gone over a piece of code wondering what it is trying to do? Most programs are not write-once. They are reworked and rewritten again and again in their lives. Bugs must be debugged. Changing requirements and the need for increased functionality mean the program itself may be modified on an ongoing basis. During this process, human beings must be able to read and understand the original code; it is therefore more important by far for humans to be able to understand the program than it is for the computer.