TheFreeSite.com!

Monday, July 28, 2008

Coding standards

In the text of this book, identifiers (function, variable and class names) will be set in bold.
Most keywords will also be set in bold, except for those keywords that are used so much that
the bolding can become tedious, such as “class.”
I use a particular coding style for the examples in this book. This style seems to be supported
by most Java development environments. It was developed over a number of years, and was
inspired by Bjarne Stroustrup’s style in his original The C++ Programming Language
(Addison-Wesley, 1991; 2nd ed.). The subject of formatting style is good for hours of hot
debate, so I’ll just say I’m not trying to dictate correct style via my examples; I have my
own motivation for using the style that I do. Because Java is a free-form programming
language, you can continue to use whatever style you’re comfortable with.
The programs in this book are files that are included by the word processor in the text,
directly from compiled files. Thus, the code files printed in the book should all work without
compiler errors. The errors that should cause compile-time error messages are commented
out with the comment //! so they can be easily discovered and tested using automatic
means. Errors discovered and reported to the author will appear first in the distributed
source code and later in updates of the book (which will also appear on the Web site

0 comments:

Tell Me Doubts In Java