Effective Java 3e

Author: Joshua Bloch
Publisher: Addison Wesley, 2018
Pages: 412
ISBN: 978-0134685991
Print: 0134685997
Kindle: B078H61SCH
Audience: Existing Java programmers
Rating: 5
Reviewer: Alex Armstrong
A third edition of a classic on Java - what could go wrong?

The good news is that in this case "nothing" is the answer. This is still a very good book in a sea of mediocre titles. The first and most important thing to say is that this is not for the beginner. It most certainly doesn't teach you Java. It is a book of best practices and some of the explanations and justification are high level enough to mean that they might go over the head of "just a Java" programmer. You need to have some concern for style and what constitutes good code. I suppose the test is whether or not you are aware that there is more than one way to write almost anything.

Just in case you skipped the Foreword, the following explains what the book is all about:

If a colleague were to say to you, "Spouse of me this night today manufactures the unusual meal in a home. You will join?"  three things would likely cross your mind: third, that you had been invited to dinner; second, that English was not your colleague's first language; and first a good deal of puzzlement.

The author then goes on to say that this is how it often is with programming languages. You might be able to speak Java, but the way that you do it might be more like a second language than something natural. The intention of the book is to explain what seems to be a natural way of expressing things in Java. On the way it also considers and discusses best practices and theories.

Banner

It starts out looking at creating and destroying objects and makes a good case for using object factories among other things. From there on to methods that all objects have and how to override them. Next we have the tension between classes and interfaces when to use which and how exactly. Chapter 5 is a collection of Generics beset practices some obvious, such as prefer lists to arrays, some far from easy to get to grips with. Chapter 6 moves back to an easier topic - enums and annotations. Next come lambdas and streams. Although I'm not sure what they are doing together in a chapter, it is all valuble information.

Chapter 8 is about nothing but methods and Chapter 9 is a general colelction of this and that. The section on not using float or double if you want exact answers is something every programmer should know, not just Java programmers.

Chapter 10 deals with exceptions; Chapter 11 concurrency and the final chapter deals with the easy-sounding, but difficult-in-practice task of serialization.

 

Obviously the book includes many of the same entries as the first and second editions - Java may have changed, but not by that much. This edition covers Java 9, but you really don't need to worry about it becoming obsolete anytime soon. Most of the new features present new problems rather than invalidating old solutions.

Don't buy a copy of this book if you want case studies or long examples. All of the ideas are illustrated by short snippets of code and if you can't see how these generalize to the real world you probably should give up programming. The big problem with this book is that you read it and come away with your head filled with the right way to do things. Some of it sticks and some you forget all too quickly. The solution? Read it again. Just flick though the pages until you see something you don't recognize. Don't buy the Kindle version - its pages don't flick.

If you are a Java programmer, and are going to continue to be a Java programmer, just buy a copy.

 

To keep up with our coverage of books for programmers, follow @bookwatchiprog on Twitter or subscribe to I Programmer's Books RSS feed for each day's new addition to Book Watch and for new reviews.

Banner


Data Science with Java

Author:  Michael R. Brzustowicz
Publisher:  O'Reilly
Pages: 236
ISBN: 978-1491934111
Print: 1491934115
Kindle: B072MKRQBQ
Audience: Java programmers wanting to use the Apache Commons math library
Rating: 3
Reviewer: Alex Armstrong

 

Java is a candidate for doing data science, so a book [ ... ]



Agile Project Management with Kanban

Author: Eric Brechner
Publisher: Microsoft Press
Date: February 25, 2014
ISBN: 97807356989536
Print: 0735698953
Kindle: B00U017N4A
Audience: Managers and teams looking to improve productivity
Rating: 5
Reviewer: Andrew Johnson 

Is Kanban a good technique for you? Read this book to  [ ... ]


More Reviews

Last Updated ( Tuesday, 05 February 2019 )