The Elements of Java(TM) Style

Front Cover
Cambridge University Press, Jan 28, 2000 - Computers - 128 pages
The 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
Bibliography
119
Index
123
Copyright

Other editions - View all

Common terms and phrases

Bibliographic information