Effective Java (Java Series)

Effective Java (Java Series) by Joshua Bloch

Effective Java (Java Series)

Binding:
Paperback
Number of Pages:
272
ISBN:
0201310058
Product Group:
book
Publisher:
Prentice Hall
Publication Date:
June 13, 2001
BooksForGeeks.com ID:
1277

You may think you're a hot Java programmer, but you aren't perfect--yet. Josh Bloch is one of the Java core architects and in Effective Java Programming Language Guide provides a Java master class.

Bloch provides 57 items (did he reject "varieties"?) grouped by subject. Each item highlights a "gotcha", expands on best practice or argues for deprecating a common practice. For example, among the gotchas, he points out problems with relying on finalisers, whose implementation varies from one JVM to another and may not run at all under some circumstances.

Best practice also gets a lot of airing. A neat example is not relying on Java's default object serialisation API, which--among other problems--can cause the object to break if you make any changes. This can result in a code maintenance nightmare. In the last category he discusses the string concatenation, "+". Using this can be a hundred times slower than appending to a StringBuffer. No problem for a one-off string but using it repeatedly can cripple performance.

Many of the items discussed are fairly trivial, such as returning zero rather than null for zero length arrays or avoiding the use of floats when you need precise answers--perhaps they were thrown in to make the magic "57"--but despite these Effective Java Programming Language Guide offers a fascinating insight into Java's architecture and solid, easily assimilated guidance on its effective usage.

Unlike most books for programmers, this is one you really will find difficult to put down. Every serious Java programmer should read it. --Steve Patient

Reviews for Effective Java (Java Series)

  1. The Java Developer's Bible

    Rated 5 out of 5 stars, July 12th, 2007

    This book is worth every penny. It explains all the best practices you should be adopting in your core Java programming, and why. It's the first book I tell people to buy once they come off their Java language training course, and I let them have a read of mine which usually convinces them.

    An essential reference, all credit to Josh Bloch for putting this together.
  2. Will open your eyes

    Rated 5 out of 5 stars, April 12th, 2007

    I was very much of the opinion that everything you need to know about programming can be found online and in the Javadocs, but gave this a chance because Josh Bloch is such a legend (he made the Collections framework). I felt several "Level Up" moments when reading this book.

    I was absolutely amazed how much stuff I had never even thought about before in Java... from extending objects that override equals (ouch! how broken is that?) to creating properly Serializable objects. And did you ever hear of 'volatile' before? You might want to go and check all your threaded code after reading this!

    Josh Bloch is the guru when it comes to publicly usable APIs and it really shows in his hints, which sometimes means you can take his advise with a pinch of salt if you aren't writing public APIs. This book will make you look back and shudder at your existing code... he even points out many pieces in the Java standard library that make him cringe!
  3. Essential

    Rated 5 out of 5 stars, August 12th, 2006

    This is a book for all developers; both new and experienced.

    As someone who has been coding in Java from 1999, I felt my understanding of the basics were fairly good. OO techniques such as inheritance, method overloading, object creation et al were fairly bread and butter for me. Reading this book has shown me numerous ways to increase the standard of my code and also given me good reasons to code the way I should.

    Many developers are aware of the fact that they should override hashCode() if they are overriding equals(), but how many could tell you why. This book does and there are many further examples like this, each one designed to highlight scenarios that can raise common (and often subtle) errors which can be easily dealt with.

    This book can almost be seen as a book of design patterns but rather than covering patterns to solve various problems (such as: front controller, composite and decorator) these patterns cover writing reliable, stable, efficient and bug free code rather than hacking something together than works.

    Essential for anybody wishing to improve their code.
  4. A Must Read for all Serious Java Programmers

    Rated 5 out of 5 stars, December 12th, 2005

    Every once in a while you read something that is truly fundamental that you can’t believe you’ve never come across it before. This book contains many of those moments. In essence it imparts most of the truly fundamental principals that you need to understand to program effectively in java.

    There are several sections covering different aspects of java programming. Bloch starts with an in depth look at some of the idiosyncrasies of the language that can lead to the creation of strange and nasty bugs. For example a surprising number of developers don’t realize that you have to override hashCode() when you override equals. Bloch goes into why. He also covers many design issues and good practices such as favouring static inner classes, favouring composition over inheritance and minimizing scope. In each case his analysis is succinct and thought provoking without ever becoming overly dense.

    Finally, the book is organized in a very accessible manor. The contents refers to the 57 items that he highlights and the judicious use of bolding in the text is simple yet extremely effective at both highlighting the important points as well as making return visits for references accessible.

    If there is one book all java programmers should have it is this one.

  5. Top quality, no flab

    Rated 5 out of 5 stars, September 12th, 2004

    If you have a basic understanding of J2SE take the time to read and understand the advice in this book. If you are an expert developer there will be something here to learn, and much to organise the knowledge you already have. There is no padding, and no skirting over issues - just high quality content from an author who is a true authority on his subject, and moreover writes in a very clear and readable style. The advice covers aspects that every Java developer should be aware of, and apply in the real world.

Our Network

BooksForGeeks.com is a participant in the Amazon Europe S.à r.l. Associates Programme, an affiliate advertising programme designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.co.uk