Best books for programmers - feature image

The Best Books for Programmers (Updated 2021)

by Sven WoltmannJune 8, 2021

In this article, I’ve compiled a list of the most relevant books for programmers.

These books are on the topics programming in general (hard skills and soft skills) and Java programming in particular.

Books for software developers are rarely suitable as audiobooks, as they often contain code examples and complex diagrams. Fortunately, there are a few exceptions. Therefore, I also indicate for each book whether it is suitable and available as an audiobook.

(Disclosure: As an Amazon Associate I earn from qualifying purchases.)

Books About Programming in General – Hard Skills

Agile Software Development: Principles, Patterns, and Practices

Book cover "Agile Software Development - Principles, Patterns, and Practices"

by Robert C. Martin

Link to the book at Amazon

In this excellent book, Robert C. Martin, also known as “Uncle Bob,” co-author of the agile manifesto, explains the core concepts of agile software development, Extreme Programming (XP), and Test-First Design (the predecessor of Test-Driven Design). He shows how to write clean, maintainable code through agile design and the application of SOLID principles. The author then demonstrates these principles and the application of well-known design patterns using three case studies developed in C++ and Java. I recommend that every programmer study these case studies intensively and implement them themselves.

The book is from 2002 and is available in a new edition from 2013, which I haven’t read yet.

Suitable as an audiobook? No. The book is full of source code and UML diagrams that are essential for understanding this book.

Growing Object-Oriented Software, Guided by Tests

Book cover "Growing Object-Oriented Software, Guided by Tests"

by Steve Freeman and Nat Pryce

Link to the book at Amazon

This book provides a practical introduction to Test-Driven Development (TDD), especially in object-oriented programming. The authors (one of whom is the developer of jMock) explain how unit tests and mock objects lead to a clean object-oriented design with reliable and maintainable code. In a case study, they design and implement an auction system in Java with a test-driven approach. I particularly recommend this book to every Java programmer. Once you’ve experienced how tests lead to more elegant design and code, you’ll never want to develop without them again.

Suitable as an audiobook? No, due to numerous code examples.

Design Patterns: Elements of Reusable Object-Oriented Software

Book cover "Design Patterns - Elements of Reusable Object Oriented Software"

by Erich Gamma, Richard Helm, Ralph E. Johnson, John Vlissides

Link to the book at Amazon

Every programmer should actually have read this classic. “Actually,” because it is written in a very academic style and therefore difficult to read – especially if you’re a non-native speaker and read it in the original English edition. It describes some of the most relevant design patterns (if not the most relevant ones of all) and their relationships with each other in great detail. You’ll notice that the book is already 25 years old: the code examples are partly outdated from today’s point of view, and they entirely ignore newer aspects like concurrency. Nevertheless, every programmer should have this work on his bookshelf and know, recognize, and apply the classic 23 design patterns.

If you prefer something more practical, I recommend the online course “Java Design Patterns” by Dr. Heinz Kabutz, author of the well-known JavaSpecialists’ newsletter.

Suitable as an audiobook? No, due to numerous code examples and diagrams.

Pattern Hatching: Design Patterns Applied

Book cover "Pattern Hatching - Design Patterns Applied"

by John Vlissides

Link to the book at Amazon

This book by one of the four authors of the classic “Design Patterns” gives insights into the development process and describes the ten biggest misunderstandings about design patterns. Frequently used design patterns are explained using practical examples – in contrast to the very academic approach in the classic. Variations of established patterns are presented, as well as two entirely new design patterns. You don’t necessarily have to read this book, but for me, it was a very pleasant and much easier to digest read after having worked through “Design Patterns.”

Suitable as an audiobook? No, due to numerous code examples and diagrams.

Working Effectively with Legacy Code

by Michael C. Feathers

Link to the book at Amazon

Tests are important. And Test-Driven-Development leads to well-tested, well-structured software. Of course, every programmer knows that nowadays. Unfortunately, this has not always been the case. And so, we are often faced with the challenge of working on a system without tests – a "legacy system" by Michael Feathers' definition.

But how do we proceed if we don't have test coverage to ensure that our changes don't break anything? And if, on the other hand, we can't write these tests because the code is too complex, contains far too many dependencies, and logic and presentation are intertwined?

What can we do if we can't instantiate the class under test because we have to pass an object to its constructor that we can't easily create? Or if the method under test accesses the database – even though that database access isn't necessary for the functionality we want to test?

This book contains a catalog of mechanisms to locate and break these dependencies. And to consequently modularize the code, creating module boundaries – so-called "seams" – where we can apply our unit tests.

The presented strategies allow you to make changes with minimal risk. Today, using the refactoring features of modern IDEs, you can perform many of these changes fully automated. These changes allow you to implement initial tests. And based on these, you can perform more far-reaching refactorings that ultimately transform the codebase into a better design.

The author explains all strategies using excellent, real-world examples, written primarily in Java and C++.

Unfortunately, the book has not been updated in 15 years. In particular, inexperienced programmers should take care not to implement every strategy dogmatically. For some mechanisms, there are better alternatives nowadays; some practices lead to worse, instead of better code; and the issue of thread safety – a core issue in most enterprise applications today – is entirely left out.

For example, these days, you don't need an interface for every class you want to mock. Mockito can easily mock classes, i.e., resolve dependencies without extracting an interface. And if you do extract an interface, please follow the Interface Segregation Principle! The author's statement, "it's nice to have an interface that covers all of the public methods of a class" (p. 366), is unfortunately in stark contradiction to this.

Invoking abstract methods from a constructor ("Extract and override factory method") is better avoided if you don't want to suddenly be faced with an object that is only partially initialized. It is for good reason that C++ forbids this practice. Fifty-five pages after the introduction of this strategy, the author finally advises against its use in Java.

Multithreading is not a topic in almost any of the older classics. Nowadays, no programmer can get around it. If you extract a class using strategies such as "Break Out Method Object", you should, therefore, add a hint that the class is not thread-safe. (Alternatively, you can protect instance variables by suitable lock mechanisms).

Despite the age-related weaknesses mentioned, I can recommend the book to any programmer who has to work with legacy code. Experienced programmers have certainly used one or the other strategy intuitively before. Other techniques may be new. Either way, the formalization helps to reinforce the strategies, and their names improve team communication.

Just keep two things in mind: the book is 15 years old, and there is an exception for every rule!

Suitable as an audiobook? No, due to numerous code examples.

The Pragmatic Programmer: From Journeyman to Master

The Pragmatic Programmer: From Journeyman to Master - Book cover

by Andrew Hunt and David Thomas

Link to the book at Amazon

This book contains concentrated, practical experience from several decades of programming practice. It presents the best practices and the major pitfalls of many aspects of software development concisely and with numerous practical examples. The focus is on creating high-quality, i.e., working, flexible, reusable, and maintainable code.

The book is suitable for both beginners and advanced programmers.

Beginners find valuable knowledge in this book that would otherwise take them years or decades to build up through their own experience (although the book cannot replace that experience, of course).

Advanced programmers can find their own experience in this book in a structured form, consolidate and deepen it – and most probably take some additional tips with them.

In addition to numerous anecdotes and analogies, each section contains practical exercises, with solutions at the end of the book. A book that every programmer should read.

Suitable as an audiobook? No, due to numerous code examples and exercises.

Extreme Programming Explained: Embrace Change

by Kent Beck and Cynthia Andres

Link to the book at Amazon

In this landmark classic from 1999 and 2005 (2nd edition fully revised with insights from five years), Kent Beck introduces the "Extreme Programming" he developed.

What sounds like common sense to today's software developers was revolutionary at the time and fundamentally changed the way we develop software. XP has led us to build software with better quality, less time, reduced cost, and higher customer satisfaction than twenty years ago.

The book presents and explains the core values and principles of XP – which were radical at the time – and the practices used to put those core values and principles into action. These include user stories and incremental design, test-driven development, continuous integration with rapid builds and feedback, and pair programming.

What must have been an inspiring book for all programmers in the dawn of agile software development is still interesting today. It is a history book that takes us to a time when XP, the origin of modern agile methods, came into being.

Suitable as an audiobook? It would be suitable as an audio book but is not available as such.

Books About Programming in General – Soft Skills

Soft Skills: The software developer’s life manual

Book cover "Soft Skills - The software developer's life manual"

by John Sonmez

Link to the book at Amazon

In this book, developer and blog author John Sonmez gives helpful advice on building the soft skills a developer should have, and which lead to a more satisfying life as a professional software developer. It’s all about career development, self-marketing, learning, productivity, investment strategies, and financial security, fitness, and mental health – all from a software developer’s perspective. For a change, if you would like to read a book for programmers without source code and diagrams, I can recommend this book.

Suitable as an audiobook? Yes, absolutely. I particularly like the fact that John Sonmez reads his books himself and repeatedly adds a few paragraphs that are not in the book.

The Complete Software Developer’s Career Guide

Book cover "The Complete Software Developer's Career Guide"

by John Sonmez

Link to the book at Amazon

This book is a comprehensive guide to a successful career in software development. It answers questions from all levels of the development career: How do I start my career? How do I get a job? In which direction can and should I specialize? How do I deal with superiors and colleagues? How do I earn a promotion? How do I develop myself? The book is written in a simple and entertaining form, enriched with personal anecdotes, and it is enjoyable to read.

Suitable as an audiobook? Yes, absolutely. I particularly like the fact that John Sonmez reads his books himself and repeatedly adds a few paragraphs that are not in the book.

The Passionate Programmer: Creating a Remarkable Career in Software Development

Book cover "The Passionate Programmer - Creating a Remarkable Career in Software Development"

by Chad Fowler

Link to the book at Amazon

This book gives software developers numerous helpful and practical tips for professional success and career development. The author describes which technical skills you should have as a programmer, how you should develop yourself technically, but also how you should not leave your career path to chance, and instead take your personal development into your own hands, pursue your own goals and remain motivated to realize them. In particular, he describes how you should market yourself as a programmer and gives numerous short recommendations for action.

Suitable as an audiobook? Yes, but the book is currently not available as such.

Books About Java Programming

Effective Java (Third Edition)

Effective Java - Third Edition - Buchdeckel

by Joshua Bloch

Link to the book at Amazon

In this book, Joshua Bloch has compiled the most important dos and don'ts of Java programming:  Best practices that help you write efficient, readable, and maintainable – and therefore future-proof – software.

The book is primarily aimed at experienced Java programmers – good knowledge of the language is required.

Some of the practices you probably already use in your daily life; others may be new to you and help you take your skills to the next level.

The book contains 90 articles ("items") divided into 11 topics. A lot of material – but you can get to grips with it bit by bit. The items each represent a self-contained unit.

Each article contains specific, easy-to-understand advice, accompanied by concise, clear source code examples.

Every Java programmer should have read this book. I recommend reading the book once entirely, and then, if you have to solve specific tasks in your daily programming routine, consult the corresponding articles again.

When buying this book (especially if you purchase second-hand), make sure that you acquire the current, third edition! The second edition is based on Java 6 and is no longer up-to-date.

Suitable as an audiobook? No, because of the numerous code examples.

Mastering Lambdas: Java Programming in a Multicore World

Book cover "Mastering Lambdas - Java Programming in a Multicore World"

by Maurice Naftalin

Link to the book at Amazon

Mastering Lambdas is an excellent book about Lambdas and Streams, introduced in Java 8. Despite their presence in the title, Lambdas occupy only about the first quarter of the book. The major part describes Streams: how to use them, how to create them, and how to terminate them using Collectors and Reducers.

I recommend this book to both beginners and advanced users. Beginners can use the book as a step-by-step introduction to the functionality of Lambda and Streams. Advanced readers learn how to develop Spliterators to generate streams as well as custom Collectors and Reducers.

Suitable as an audiobook? No, due to numerous diagrams and code examples.

Java Generics and Collections

Book cover "Java Generics and Collections"

by Maurice Naftalin and Philip Wadler

Link to the book at Amazon

While these days, most Java developers can skip the book’s introduction to generics, the book quickly addresses advanced topics such as Subtyping, Wildcards, Wildcard captures, and Bounds – topics that every Java programmer has probably had to deal with before, but has usually walked through compiler errors rather than knowing what they did.

In the second part of the book, the author presents the essential Collection interfaces and classes of the Java Collection Framework – Sets, Queues, Lists, and Maps, as well as their implementations – and compares them regarding concurrent programming and performance.

Any advanced Java programmer should be familiar with these topics.

Suitable as an audiobook? No, due to numerous code examples.

Concurrent Programming in Java: Design Principles and Pattern, 2nd Edition

by Doug Lea

Link to the book at Amazon

Concurrency has always been a first-class citizen in Java. Threads, monitors (keyword "synchronized"), and guarded blocks ("wait"/"notify") have been part of the language since Java 1.0.

"Concurrent Programming in Java" is from 1999 and thus on the level of Java 1.2. Nevertheless, the described challenges of concurrent programming (security, liveness, performance) are still relevant today. So are the presented principles and design patterns, like synchronization and confinement, monitors, guarded waits and notifications, latches, worker threads, futures, fork/join, and many more.

Abstracting from this, the author introduces more complex, reusable utility classes for initiating and coordinating concurrent activities. Most of these classes are today – in an evolved form – part of the JDK. In the JavaDoc of these classes (e.g., Semaphore, ReentrantLock, Executor, or CountDownLatch – and in newer ones like CompletableFuture or StampedLock), you will find the signature of Doug Lea, the author of this book.

The book is not a light read. The writing style is academic and highly challenging. I had to read many paragraphs more than once and keep cross-referencing to other parts of the book to understand. With the examples, it is sometimes advisable to read the theory first, then the source code, and then the theory again. Every few pages, you have to take a break.

It took me several weeks to work through the entire work. But it is definitely worth the effort!

Once you have internalized the basics of this book, you will be able to write performant, thread-safe code and quickly recognize non-thread-safe code as well as the causes of race conditions. That will make you one of the most sought-after Java programmers.

Suitable as an audiobook? No, due to numerous diagrams and code examples.

Bad Tests, Good Tests

by Tomek Kaczanowski

Link to the book at Amazon

Tests and test-driven development (TDD) have arrived in most IT teams. Tests are supposed to assure the correct behavior of new and existing features, to survive refactorings unscathed, as documentation to make it easier for new developers to get started with the code, and – on top of that – lead to clean(er) code.

Unfortunately, many tests are not worth the time spent developing them. They are poorly readable and maintainable. And they often need adjustments during refactorings because they don't verify the result of an operation but how the operation was executed.

Bad Tests, Good Tests uses numerous examples (about half of the book contains code) to explain what constitutes bad tests – examples as the author has found them in real projects. The author then contrasts each example with specific suggestions for improvement.

The range of shortcomings goes from poor readability (e.g., long setup or assertion blocks) and obvious errors (e.g., forgotten assertions) to incomplete tests (that don't fail despite functionality changes) and subtle errors (e.g., exceptions thrown in places other than expected) to completely useless tests (that, e.g., verify the test library instead of your code).

The book is exceptionally hands-on and suitable for both beginners and advanced developers.

Beginners don't have to repeat the mistakes that others have made before them. Advanced programmers will surely recognize one or the other anti-pattern from their daily work and can fill their toolbox with new techniques.

The author writes understandably and humorously. And he explicitly points out that one may also break his rules if it serves the cause in the individual case.

A clear recommendation for every Java developer.

Suitable as an audiobook? No, due to countless code examples.

Bonus: Novels

Mostly I read technical books. But now and then, when I get a good recommendation, I also read a novel. I want to recommend some of the books that fascinated me most:

The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win

Book cover "The Phoenix Project - A Novel About IT, DevOps, and Helping Your Business Win"

by Gene Kim, Kevin Behr, George Spafford

Link to the book at Amazon

An entertaining and insightful story about the transformation of an old, traditional IT department into a modern agile DevOps team.

Bill is appointed head of the IT department and is to help the “Phoenix” IT project, which is under massive pressure from features and deadlines, to succeed. He is confronted with problems that many of us know only too well: Uncompleted features planned months in advance; manual deployments that go wrong and keep the operations department awake night after night; developers who blame operations and vice versa; employees who turn directly to developers – bypassing all processes. Bill has 90 days to fix the mess; otherwise, his department will be outsourced.

Suitable as an audiobook? Yes, absolutely.

The Unicorn Project: A Novel about Developers, Digital Disruption, and Thriving in the Age of Data

The Unicorn Project - Buchdeckel

by Gene Kim

Link to the book at Amazon

"The Unicorn Project" is set in the same location and time as "The Phoenix Project". It tells the story not from a management point of view, but from the perspective of top programmer Maxine, who is transferred to the Phoenix project as punishment.

There she tries to compile the Phoenix project and encounters problems that most of us know only too well: lack of documentation about setting up the development environment, missing accesses, insufficient tests, non-existent build and deployment automation, inadequate infrastructure – both for testing and production.

Maxine's determination and perseverance help her get closer to her goal step by step. In doing so, she encounters a secret underground organization, the "Rebellion", which has the goal of replacing outdated approaches with modern software development principles.

Like its predecessor, the book shows what is possible when a traditional company is open to the necessary changes of the digital age. It is entertaining, easy to read, and it is pleasant to meet some familiar characters again.

Suitable as an audiobook? Yes, absolutely.

Ender’s Game

Book cover "Ender's Game"

by Orson Scott Card

Link to the book at Amazon

Ender’s Game is the first part of a science fiction epic and, for me, one of the best novels I’ve ever read. The story is about a young boy, Ender, being recruited for a training program to defend Earth against a threatening invasion by an alien species.

I don’t want to tell you more about the plot. There are several follow-up novels – the first four parts are also available as a set: The Ender Quartet.

Suitable as an audiobook? Yes, including the sequels.


Book cover "Seveneves"

by Neal Stephenson

Link to the book at Amazon

An epic science fiction story that feels like a work comprising several novels, and that captivated me from beginning to end. Something completely different than I’ve known before. I don’t want to tell anything about the story so as not to take the tension away. I also recommend not reading the description on Amazon, because, in my opinion, it reveals too much. Barack Obama and Bill Gates both recommended this book.

The book has “only” 4.0 stars at Amazon – a rating that I cannot comprehend. Most readers criticize that the author describes technical correlations in too much detail. I liked that, and therefore, it is a definite recommendation for every other programmer.

Suitable as an audiobook? Yes.

Sven Woltmann
About the author
I'm a freelance software developer with more than two decades of experience in scalable Java enterprise applications. My focus is on optimizing complex algorithms and on advanced topics such as concurrency, the Java memory model, and garbage collection. Here on, I want to help you become a better Java programmer. Read more about me here.

Leave a Reply

Your email address will not be published. Required fields are marked *

You might also like the following articles