Clean Code: A Handbook of Agile Software Craftsmanship
Review by Sven Woltmann
This classic software development book is, as the name suggests, about clean code: Code that not only works but, above all, is easy to read and maintain.
This includes:
- meaningful names,
- short functions that perform one task at a consistent level of abstraction,
- meaningful (or no) comments (as opposed to comments that merely repeat what the code does, or worse, what it did once upon a time),
- a consistent code style,
- a clean class structure (this point is covered in more detail in the previously mentioned “Agile Software Development: Principles, Patterns, and Practices”)
- error handling that does not obfuscate the actual business logic,
- unit tests, optimally test-driven in origin.
The principles presented are elaborated through several concrete Java case studies.
The book is easy to understand and entertaining to read through occasional anecdotes. Every developer should read this book and make the principles presented second nature.
The chapter on concurrency is unfortunately enormously simplified (without pointing this fact out). Modern optimizations such as instruction reordering and CPU cache effects are not addressed. Thus, after reading this chapter, the reader can quickly believe in deceptive security and produce subtle bugs that are hard to find afterward.
To gain confidence in writing concurrent applications, I highly recommend Brian Goetz’s “Java Concurrency in Practice” to any Java developer.
Finally, a personal tip about code style: Don’t make up your own style. Save yourself the countless discussions in your team and instead use an existing, widely used style for which there is documentation, checkers, formatters, and IDE plugins. A good example is Google’s Java Style Guide and the associated tools.
🎧 Suitable as an audiobook? No! Even though this book inexplicably exists as an audiobook, it is not suitable as such due to the numerous code examples.
Other Recommendations From This Book’s Genres
Clean Craftsmanship: Disciplines, Standards, and Ethics
The Clean Coder: A Code of Conduct for Professional Programmers
Agile Software Development: Principles, Patterns, and Practices
Clean Architecture: A Craftsman’s Guide to Software Structure and Design
Design Patterns: Elements of Reusable Object-Oriented Software
Refactoring: Improving the Design of Existing Code
Working Effectively with Legacy Code
The Pragmatic Programmer: From Journeyman to Master
Growing Object-Oriented Software, Guided by Tests
Clean Agile: Back to Basics
Pattern Hatching: Design Patterns Applied
Domain-Driven Design: Tackling Complexity in the Heart of Software
Implementing Domain-Driven Design
Extreme Programming Explained: Embrace Change
The Unicorn Project: A Novel about Developers, Digital Disruption, and Thriving in the Age of Data