Chapter 1: Clean Code
Why clean code matters, the cost of bad code, and what experts say good code looks like.
Why clean code matters, the cost of bad code, and what experts say good code looks like.
Designing small, cohesive classes with a single responsibility and organizing them for change.
Separating system construction from use, dependency injection, and scaling clean architecture.
Kent Beck's four rules of simple design and how following them leads to emergent good design.
The challenges of concurrent programming and principles for writing safe, clean concurrent code.
A case study showing how iterative refactoring transforms a messy first draft into clean code.
A case study refactoring real JUnit source code to demonstrate clean code principles in practice.
A thorough case study refactoring a real-world date library to illustrate deep clean code principles.
A comprehensive catalog of code smells and heuristics for identifying and fixing bad code.
How to choose names that reveal intent and make code self-documenting.
Rules for writing small, focused functions that do exactly one thing well.
When comments help, when they hurt, and why good code rarely needs them.
Code formatting as communication — how visual structure conveys meaning and intent.
The fundamental tension between objects and data structures, and when to use each.
Writing error handling that is robust, clean, and doesn't obscure your business logic.
Strategies for cleanly integrating third-party code and managing the edges of your system.
Why tests must be clean, what makes a good test, and the F.I.R.S.T. principles.
Clean Code - A Handbook of Agile Software Craftsmanship by Robert C. Martin