Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming Books Media Book Reviews IT Technology

Effective Java 157

benjiboo writes "From the back page: 'Are you looking for a concise book packed with insight and wisdom not found elsewhere? Do you want to gain a deeper understanding of the Java programming language? Do you want to write code that is clear, correct and reusable?' I did, so I bought the book and decided to use it for my first review :)" Read on for bejiboo's review of Effective Java.
Effective Java Programming Language Guide
author Joshua Bloch
pages 252
publisher Addison Wesley
rating 8/10
reviewer Ben
ISBN 0201310058
summary 57 pieces of Java wisdom.

Introduction

Effective Java is a book very much in the style of Scott Myers' earlier C++ "Effective" series. The book contains 57 individual snippets of Java wisdom, broadly categorised into 10 sections including Classes and Interfaces, Exceptions, Threads and Serialisation. Scott Myers' books are classics; I was interested to see how this would compare.

The author, Joshua Bloch, has been involved in writing many industrial-strength Java libraries. His background is very much evident, in this, his first text. He consistently demonstrates the virtues of favouring libraries, clean APIs and advance design. I found the author very readable, and able to make a convincing argument, even in his more 'controversial' pieces. As with Scott Myers' books, there is a real-world, rather than purist approach taken to the language, with most of the code examples having a real-world feel to them. This is a breath of fresh air when lots of programming books tend to use more contrived examples.

The items

The author has endeavoured to keep the book accessible to less-experienced programmers throughout, while providing food for thought for the more advanced reader. For the most part this is succesful, but a small percentage of articles tend toward the simple side. Examples include 'Minimise the accessibility of classes and embers,' 'Write doc comments for all exposed API elements,' and 'Know and use the libraries.' We've all heard this advice many times and I don't feel that these add value. The vast majority however, are pitched at the right difficulty level. The selection of items is well balanced and broad, although unfortunately there are none pertinent to GUI programming.

Many of the articles are fundamentally based on known design patterns and idioms. Although a useful index to these patterns is included, I would have liked to see the virtues of design patterns summarised and demonstrated to a greater extent, perhaps in the introduction.

I was highly impressed with all code examples. Where used, they are consistently short, relevant and concise, with more verbose examples included on the website. The chosen code examples only ever assist in explaining complex concepts clearly.

The strongest area of the book for me was the section on threading. The author clearly demonstrates, for instance, how overuse of synchronised methods can lead to deadlock. He also provides food for thought on how the thread scheduler might trip us up. A section on moving from C constructs, which initially struck me as an odd category, proved very interesting and thorough. 'Replace enum constructs with classes' is a particularly interesting item, demonstrating the fragility of C enums, and indicating why the often-used replacement in Java (a bunch of public static constants) suffers from the same failings.

In conclusion

Ideally I would have liked to see some of the thinner items removed, and perhaps replaced with a section on the GUI libraries. I also liked the short prose sections, and thought the author could have spent more time setting out his stall before launching in to the items. Having said this, this is one of those rare books which could help a good programmer become an excellent one. Many of the books currently out there are aimed at either the beginner or the guru, and this book fills a gap.

I find this style of book very useful, in that I could foresee meeting the vast majority of the described situations at some point or another. So long as you aren't looking for tips to help you with your GUIs, this title is more than worth the investment.

For anyone interested, those sections in full:

  • creating and destroying objects
  • methods common to all objects
  • classes and interfaces
  • substitutes for C constructs
  • methods
  • general programming
  • exceptions
  • threads
  • serialisation


You can purchase Effective Java from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

This discussion has been archived. No new comments can be posted.

Effective Java

Comments Filter:
  • thanks benjiboo (Score:1, Interesting)

    by nuffle ( 540687 ) on Wednesday January 15, 2003 @12:40PM (#5088394)
    thanks for submitting a rare thing: a good slashdot book review. timothy, if you want us to pay any attention to these reviews, you need to keep the quality more like this one.
  • by Hirofyre ( 612929 ) on Wednesday January 15, 2003 @01:34PM (#5088681)
    There are a lot of Java books out there, but this is one that will help an intermediate-to-advanced Java developer. The code examples in here are concise, clean, and hard-hitting. The layout of the book allows you to pick it up and learn something if you have 10 minutes or 2 hours.
    When I was first learning Java, I often had that nagging feeling that I was making things harder on myself than need be. This book cleared up a lot of those feelings, and helped get me on the right track for some of the great tools hidden away in the Java API. The API documentation is great for showing you what members and functions are available to an engineer, but this book shows you how to use the API. The review cites the author's avocation of knowing the libraries, I would contend that this book would help you get the most out of those libraries, and increase your understanding of them.
    This book has become a must-have around my office, and if you are looking to get over-the-hump and move from an intermediate to advanced java software engineer, pick up this book. It is dense with information, and will save you a ton of time and energy. What more could you ask for from a book?
  • by goul ( 41924 ) on Wednesday January 15, 2003 @02:06PM (#5088848)
    Indeed. It might be worth noting that James Gosling (one of the parents of Java) describes this as a book he needs.
    This book will show you any bad habits that you have picked up, and teach you why they are bad. I've not found a single developer of any level of experience who has not found this book useful.
  • Read this book a lot (Score:3, Interesting)

    by mobiGeek ( 201274 ) on Wednesday January 15, 2003 @02:44PM (#5089111)
    This is not a read-once-keep-on-bookshelf book. This book should be read through a few times at least.

    I rarely find a tech book that offers more than a few examples I ear-mark. This book however has me re-reading it from time to time. The lessons picked up take time to sink in, and IMO no one can truly pick up all of the lessons on one read through.

I've noticed several design suggestions in your code.

Working...