The Elements of Java(TM) StyleThe Elements of Java Style, written by renowned author Scott Ambler, Alan Vermeulen, and a team of programmers from Rogue Wave Software, is directed at anyone who writes Java code. Many books explain the syntax and basic use of Java; however, this essential guide explains not only what you can do with the syntax, but what you ought to do. Just as Strunk and White's The Elements of Style provides rules of usage for the English language, this text furnishes a set of rules for Java practitioners. While illustrating these rules with parallel examples of correct and incorrect usage, the authors offer a collection of standards, conventions, and guidelines for writing solid Java code that will be easy to understand, maintain, and enhance. Java developers and programmers who read this book will write better Java code, and become more productive as well. Indeed, anyone who writes Java code or plans to learn how to write Java code should have this book next to his/her computer. |
Contents
General Principles | 1 |
Formatting Conventions | 5 |
Naming Conventions | 15 |
Package Names | 18 |
Type Names | 20 |
Interface Names | 22 |
Method Names | 23 |
Variable Names | 25 |
Internal Comments | 52 |
Programming Conventions | 57 |
Type Safety | 64 |
Statements and Expressions | 66 |
Construction | 70 |
Exception Handling | 72 |
Assertions | 75 |
Concurrency | 79 |
Field Names | 27 |
Parameter Names | 28 |
Constant Names | 29 |
Documentation Conventions | 31 |
Comment Types | 32 |
Documentation Comments | 36 |
Comment Style | 38 |
Comment Content | 49 |
Synchronization | 80 |
Efficiency | 85 |
Packaging Conventions | 89 |
Summary | 95 |
Glossary | 105 |
119 | |
123 | |
Other editions - View all
The Elements of Java(TM) Style Allan Vermeulen,Scott W. Ambler,Greg Bumgardner,Eldon Metz,Trevor Misfeldt,Jim Shur No preview available - 2000 |
Common terms and phrases
abstract class Accessed online apply assertions Barbara Liskov base class behavior BitSet block statement boolean break statement Brian Kernighan Canvas checked exception Class method class or interface classes and interfaces client Color concrete type concurrency construct Conventions create dead code elimination declaration dependency derived class documentation comments double drawShape end-line comments entity executing fall-through field final static int following code fundamental data types implementation indentation inner classes instanceof int index Java JavaBean Javadoc tag Javadoc utility keywords lazy initialization Liskov Substitution Principle lowercase mechanism MyClass null object operations P. J. Plauger package name parameter postconditions preconditions public abstract public class public final static public static final Rectangle2D release Rogue Wave Rule Shape ShapeList source code standard String name style subclass summary description Sun Microsystems superclass switch statement synchronized this.first this.name threads tion toLowerCase Type Safety users verb