This appendix is not meant to be a stand-alone coding standard it simply describes some of the things you would want to put in your own Java coding standard. You should use this template as the basis for your own standard and tailor it to meet the requirements of your particular development organization.
This sample standard borrows heavily from the Java Style Guide , initially an internal Sun paper by Achut Reddy and now available in its complete form on the Sun home page at http://sun.com. We wish to thank Mr. Reddy for his permission to use this style guide as a basis for the sample Java coding template presented herein.
The importance and benefits of a consistent coding style are well known. A consistent style:
improves the readability, and therefore the maintainability of code
facilitates sharing of code among different programmers;
allows easier development of automated tools to assist in program development, including tools that automatically format code using these style guidelines;
makes it easier to conduct code reviews, another software engineering process with well-known benefits. In turn , a practice of regular code reviews can help enforce a consistent style; and
saves development time, once the guidelines are learned, by allowing programmers to focus on the semantics of the code, rather than spend time trying to determine what particular format is appropriate for a given situation.
However, no standard is meant to be rigidly enforced without exception. This document does not cover all possible situations. Experience and informed judgment should be used wherever doubt exists. Consistency of coding style is more important than using a particular style.