Book review: Head First Java, third edition

July 29, 2022 | 5 minute read
Text Size 100%:

This book teaches Java using an unorthodox method that relies on corny jokes, vintage photographs, crosswords, puzzles, and scribbled notations.

Download a PDF of this article

Head First Java, 3rd Edition
Head First Java, Third Edition
By Kathy Sierra, Bert Bates, Trisha Gee

This book is part of the celebrated Head First series developed by user-experience expert Kathy Sierra and her husband Bert Bates. The series uses an unorthodox method of presenting information that relies on corny jokes, vintage photographs, crosswords, puzzles, scribbled notations, and other techniques not normally associated with programming instruction. It is a coordinated form of gamification, which makes learning the material fun and in which successive points reinforce earlier ones. Figure 1 shows a representative page with cartoons, annotated code, and lighthearted explanations.

A sample page from Head First Java, Third Edition.
Figure 1. A sample page from Head First Java, third edition

The success of the Head First series testifies to how effective this informal but carefully crafted presentation is. While it is ideal for beginners looking to learn the language in a lighthearted way, the successive expansion of previously explained points makes the books unsuitable as reference volumes.

Because Head First Java is a tutorial, let me explain that Java tutorial books can be divided into three different styles.

  • There is the formal presentation of the information, which is intended for experienced programmers and designed to be used later for reference (the paragon of this model is Core Java, which I reviewed earlier this year).
  • There is the approach adopted by Joel Murach, such as in Murach’s Java Programming, which presents a small problem and its solution in a two-page spread that illustrates a language feature.
  • And there’s the more whimsical method adopted in Head First Java.

This third edition adds Trisha Gee to the previous author duo. Gee is a Java Champion—familiar to many Java Magazine readers, I expect—due to her years as a developer advocate for JetBrains. In the past, she has developed video Java classes and written occasional articles, such as this thoughtful discussion of code review antipatterns in Java Magazine. Her participation in this edition helped bring a book that had not been updated since 2005 into the present. In that sense, this edition is not so much an update as it is a rewrite.

Head First Java assumes the reader to be either new to programming or somewhat familiar, but far from expert, at programming. Many sections use the approach celebrated in the “explain like I was five years old” (ELI5) meme: explaining concepts in basic terms and then supporting the examples with diagrams, short quizzes, and frequent sidebars in which the authors anticipate questions a reader will have, such as “Didn’t you earlier say X?” or “What’s the difference between this and Y?”

By these varied means, the hope (and, I believe, the attained result) is that topics are learned well. To do this effectively, topics must be broken down into discrete, spoon-fed subtopics. This approach requires considerable care, but the results are convincing. For example, the explanation of lambdas is the clearest and most approachable I’ve seen anywhere.

Despite the number of pages required for the discussion of a single topic, a very large subset of the Java language is presented in the 700+ pages. Advanced topics include streams, serialization, Swing and JavaFX overviews, and concurrency. In keeping with the genuine informality conveyed by the text, a list of the top 10 topics not covered in the book is presented at the end. How many books have that kind of transparency?

While the book’s Java code is reliably good, there are small errors in the related text. The most vexatious to me was the oft-repeated contention that stdout prints “to the command line.” Such a mishmash of concepts is sure to confuse neophytes who will unwittingly adopt this language and be surprised to be corrected by professional developers. Why not state the simpler and more accurate: “It prints to the screen”?

Here and there, I found other kinds of errors. For example, the contention that one of the tenets of test-driven development (TDD) is “no killer schedules; work regular hours.” This goal is not part of TDD. In the previous edition of this book, this phrase was included in a list of the tenets of extreme programming, where “no killer schedules” is indeed a goal of the practice. That text was incorrectly migrated to refer to TDD in this edition.

Small errors like these mar an otherwise excellent Java tutorial. As I mentioned earlier, the explanations when it comes specifically to Java are reliably good and even brilliant in places. On the basis of that quality, I can recommend this book to beginners who want to teach themselves Java and work at their own pace. They will certainly emerge with a very solid understanding of the language and the ability to write simple programs correctly.

A side note about the authors

In publishing, when a new edition of a popular book comes to market, it is customary for the authors’ names to appear in the same order they were in for the previous edition. Authors contributing new material are generally placed after these authors, as is the case here.

This is important with this edition because the lead author is Kathy Sierra. Some readers will recall that Sierra wrote a justifiably admired blog on usability. Unfortunately, the high esteem in which she was held attracted a shockingly vicious and highly personal attack by a troll beginning in 2007.

While many observers came to Sierra’s defense during the troll’s campaign (including statements from this reviewer), Sierra chose to cease blogging and leave the industry rather than face continued verbal assault by this particular troll.

Readers familiar with these events who lament the loss of Sierra’s contributions might mistake her name on this new edition as a signal that she has returned to writing for the tech audience. Sadly, this is not the case, and she had little participation in this edition. Her name as lead author on this volume is merely the result of the publishing custom for new editions.

Dig deeper

Andrew Binstock

Andrew Binstock (@platypusguy) is the lead developer on the Jacobin JVM project—a JVM written entirely in Go. He was formerly the editor in chief of Java Magazine, and before that he was the editor of Dr. Dobb’s Journal. Earlier, he cofounded the company behind the open source iText PDF library. He lives in Northern California with his wife, and when he’s not coding, he studies piano.


Previous Post

Quiz yourself: The allowable subtypes in sealed classes

Mikalai Zaikin | 3 min read

Next Post


Design and document for inheritance—or else prohibit it. Here’s how.

Joshua Bloch | 10 min read