Effective Java 157
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.
From the people who brought you: (Score:0, Funny)
Military Intelligence
Advanced BASIC
Resident Alien
Found Missing
now comes Effective Java, another great title in the series by noted author Ox E. Moron
Effective Java? What is this Java? (Score:3, Funny)
Do not talk of this Java Sanctuary. There is no such thing.
Effective Java (Score:0, Funny)
Hey when you are done slashdotting, check out the hot babes on Pajonet's [pajonet.com] hot or not contest!
Java Rules (Score:3, Funny)
Man, I'm barely done with Douglas Dunn's [amazon.com]
Java Rules and now I gotta read this?
Actually, I'm glad to see more book son coding effectively as opposed to the dummy approach which is a sure way to Shoot yourself in the foot [healyourch...ebsite.com] when the maintenance phase rolls around.
That said, one thing copiously missing from the review is whether or not the book covers J2EE at all -- which by and far requires some guidance in the developing the most effective Java applications.
Confused by expression (Score:3, Funny)
What does 'setting out his stall' mean? I picture somebody settling on to the toilet and opening the newspaper, but in the context I don't think that's what you meant.