FREE Shipping on orders over CDN$ 25.
Only 1 left in stock (more on the way).
Ships from and sold by Gift-wrap available.
The Elements of Java(TM) ... has been added to your Cart
+ CDN$ 6.49 shipping
Used: Very Good | Details
Sold by bwbuk_ltd
Condition: Used: Very Good
Comment: Ships from the UK. Former Library book. Great condition for a used book! Minimal wear. 100% Money Back Guarantee. Your purchase also supports literacy charities.
Have one to sell?
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See all 3 images

The Elements of Java(TM) Style Paperback – Jan 28 2000

4.2 out of 5 stars 28 customer reviews

See all 4 formats and editions Hide other formats and editions
Amazon Price
New from Used from
Kindle Edition
"Please retry"
"Please retry"
CDN$ 22.95
CDN$ 19.62 CDN$ 0.01

Save an Additional 10% on Textbooks When you Join Amazon Student

Special Offers and Product Promotions

  • Amazon Student members save an additional 10% on Textbooks with promo code TEXTBOOK10. Enter code TEXTBOOK10 at checkout. Here's how (restrictions apply)

No Kindle device required. Download one of the Free Kindle apps to start reading Kindle books on your smartphone, tablet, and computer.

  • Apple
  • Android
  • Windows Phone
  • Android

To get the free app, enter your e-mail address or mobile phone number.

Product Details

  • Paperback: 146 pages
  • Publisher: Cambridge University Press; 1 edition (Jan. 28 2000)
  • Language: English
  • ISBN-10: 0521777682
  • ISBN-13: 978-0521777681
  • Product Dimensions: 17.7 x 0.8 x 23.4 cm
  • Shipping Weight: 213 g
  • Average Customer Review: 4.2 out of 5 stars 28 customer reviews
  • Amazon Bestsellers Rank: #566,677 in Books (See Top 100 in Books)
  •  Would you like to update product info, give feedback on images, or tell us about a lower price?

  • See Complete Table of Contents

Product Description


"This is a great book for the beginner or intermediate developer -- experts should already know this stuff. It will help you create better, cleaner, more easily maintained code. If you work with other developers, I recommend getting several copies for the group...The Elements of Java Style proves that 'Good things come in small packages.' Physically, it's a small book, and weighs in at just 142 pages. However, the positive impact it can have on your work is all out of proportion to its size. That's because the ideas presented aren't limited to a single language, and the way the ideas are presented is very compact. The Elements of Java Style isn't about the code you write, it's about the way you write. Its central premise is that your writing style either enhances or decreases the readability and understandability of the code you write...Over the years, I've read lots of books that I would recommend to different developers, but this book is one of a few that I would recommend to all developers. Pick up a copy, give it a read, and I think you'll agree."

"The Elements of Java Style is a useful resource for those wishing to refine their skills in the language and apply them in a team environment."
Science Books & Films

"By and large there is little to argue about. The Elements of Java Style is perfect in what it tries to achieve."
The Development Exchange's Java Zone

Book Description

Renown author Scott Ambler and a team of Rogue Wave Software developers have joined together to write The Elements of Java Style. While there are many books that explain the syntax and basic use of Java, this book explains not just what you can do with the syntax, but what you ought to do. It illustrates rules with parallel examples of correct and incorrect usage. Not only will Java developers and programmers who read this book write better Java code, but they will become more productive as well. Programmers who take the time to write high-quality code from the start will find it easier to modify it during the development process.

Inside This Book

(Learn More)
First Sentence
While it is important to write software that performs well, many other issues should concern the professional Java developer. Read the first page
Explore More
Browse Sample Pages
Front Cover | Copyright | Table of Contents | Excerpt | Index | Back Cover
Search inside this book:

Customer Reviews

Top Customer Reviews

Format: Paperback
Hi there!
This booklet is a significant tool in achieving correct effective and easily maintainable code:
1. Specifying the way code should be written, conforming with sun's coding conventions, keeps the code readable, and Java-docs coherent.
This is especially important when writing the code in a teem, or writing components which will be later used by others.
2. Chapter 5 lists a collection of coding tips, which can quickly turn a beginner programmer into an experienced one.
rule 81:
"Do not call nonfinal methods from within a constructor -
Subclasses may override nonfinal methods, and java will dispatch a call to such a method according to the actual type of the constructed object - before executing the derived constructors. This means when the constructor invokes the derived method, the derived class may be in an invalid state. To prevent this, call only final methods from the constructor. "
More about the book:
(note: this booklet does not teach Java, it focuses on the way the code should be written.)
The booklet is fun to use:
1. It is tiny, and fits anywhere.
2. Not intimidating - It is thin and distilled, not like those
huge books you put on the shelf and
never bother to open because you don't
know where to begin looking...
2. It is written in a simple direct logical manner:
a rule and a short explanation (with an example)
of the logic behind it.
3. Easy to locate what you are looking for.
4. every time you open it - you find something new...
In short - a handy reference for producing expert code!
I love it!
Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again.
Report abuse
Format: Paperback
A good coding standard should focus on advice that encourages the correct and consistent application of a language. The more widely-adopted a standard is, the more benefit. No less than the Java Language Specification acknowledges this by listing a limited set of naming and usage practices. While the JLS falls far short of establishing a complete coding standard, the naming conventions it established have alone been of great benefit to the Java community. The "Elements of Java Style" nicely fills the gap left by the JLS in other areas, although it too falls a little short in places--thus the 4 star rating instead of 5.
I strongly suggest "Effective Java" by Joshua Bloch as a companion to this book. Whereas the 108 rules in this book focus on style, format and many pearls of practical advice, "Effective Java" provides an excellent set of 57 rules that go much deeper and tackle more advanced aspects of writing correct and consistent code. The two books complement each other well.
Of the 108 rules, the most glaring technical error is rule #99 which promotes the use of the flawed double-check synchronization pattern. Ignore this rule.
The 108 rules are divided into six chapters as follows:
4 General Principles: While I would have added a few, the four here are quite sound.
4 Formatting Conventions: Programmers tend to get weird about code format. After long enough you realize any reasonable and consistently adhered to standard is fine, so just use this well-considered set.
23 Naming Conventions: These are of great benefit as they resolve the ambiguities left by the JLS. I especially like rule #12, "Join the vowel generation".
Read more ›
Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again.
Report abuse
Format: Paperback
Two things immediately irk me in this book.
First is the sloppy K&R style that I really find irritating to debug:
public class MyClass { ... }
The curly brackets belong inline so you know where the SCOPE of the code begins and ends like this:
public class MyClass { ... }
This is much more readable and easier to figure out which brackets go with which statement, especially when you have multi-nested statements! Think of it this way if you write a pascal program you don't write it like this
procedure MouseUp(integer Xpos, integer Ypos) begin ... end;
The debate over using Tab or spaces is less irritable except when I have to modify a nested class and have to spend alot of time counting spaces when a couple tabs would have cost less time. Also when you use tabs, the block structure really stands out well. The block structure is the whole reason for using the basic C syntax, so if you bland the block by only having two space tabs and hiding the begining curly bracket, the block does not stand out. you can't see the forest for the trees.
The other complaint is the lack of Hungarian or an mention of it. Knowing the type by having it in the name of the method, var and class can save hours of time looking for the definition as well as save time naming them. iZipCode tells me right away that the zip is stored as an int and not a string.
Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again.
Report abuse
By A Customer on May 2 2001
Format: Paperback
For the most part, this book is a great style guide for Java programmers. Most Java programmers' code would benefit significantly by following the conventions listed here.
However, the book gives some bad and confusing advice. The worst advice is the double-check pattern, which is not thread-safe. Some of the other code samples in the Synchronization and Efficiency sections also look like they are not thread-safe. Another example of poor advice is rule 74: Encapsulate enumerations as classes, which doesn't point out that "null" is a valid enumeration value for all such enumerations. The code sample shown in that rule can throw NullPointerException, for example. The advice about "inner classes" is confusing, because it is obvious the advice actually applies to all nested classes, not just inner classes (non-static nested classes).
Overall, the book gives good advice to the experienced Java programmer. I can't recommend this book to the beginning Java programmer, partly because of the above reasons, but mostly because the book mentions so many aspects of the Java language it could easily overwhelm a beginner. Once you've mastered the basics of the Java language, however, this is a good book to take a look at.
Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback.
Sorry, we failed to record your vote. Please try again.
Report abuse

Most recent customer reviews