«

»

Sep
16

Effective Java Second Edition

I recently picked up a copy of the second edition of Effective Java having owned a copy of the first edition for several years. Its a book I have always recommended to anybody new to Java because whereas many books on Java discuss the letter of the language, this book discusses the spirit, and puts it into clear context, leaving the reader in no doubt of (a) how to use particular language features, but (b) where and why to do so.

Having worked with some Java 5 features for the last couple of years I have picked up autoboxing, generics and enums in a casual way. Taking the new edition on holiday proved a boon when the whole family fell ill – I had the chance to spend a couple of days reading in. Very quickly I learnt more about the right way to use the Java language, partly because I never read the original from cover to cover, but referred to it when I was puzzling over an implementation detail. Mostly, though, because the book is a very effective training course on the new areas of the Java language.

I had been picking up the new features around generics – converting Java 1.4 code to Java 1.5 had left warnings that I had no urgency to address – but having read about half of the new edition I have been able to quickly eradicate most of the outstanding warnings in my code, either by fully utilising generics, or through annotations to suppress the warnings that occur when using legacy code from Java 5/6 code (not the right approach, but it will suffice for now).

Mr Bloch has done an excellent job of rewriting his book and whether you have a copy of the first edition or not, I strongly recommend you purchase a copy of the second edition if you are serious about producing the best quality Java code you can.