Foreword xix
Introduction xxv
Introduction (from Long Ago) xxix
About the Author xxxi
Chapter 1: Clean Code 1
There Will Be Code 2
Bad Code 3
The Art of Clean Code 5
Putting All This Together 9
We Read More Than We Write 13
The Boy Scout Rule 14
Part I: Code 17
Chapter 2: Clean That Code! 19
The Cleaning Process 30
Conclusion 37
Postscript: Future Bob Playing with Grok3 37
Postscript Conclusion 40
Chapter 3: First Principles 41
Everything Small, Well Named, Organized, and Ordered 42
A More Significant Example 44
A Final Thought 68
Chapter 4: Meaningful Names 71
Use Intention-Revealing Names 72
Final Words 87
Chapter 5: Comments 89
Compensating for Failure 90
Good Comments 92
Bad Comments 97
Conclusion 115
Chapter 6: Formatting 117
The Purpose of Formatting 118
Vertical Formatting 118
Horizontal Formatting 127
Team Rules 132
Uncle Bob's Formatting Rules 133
Chapter 7: Clean Functions 137
Small! 138
Reading Code from Top to Bottom: The Stepdown Rule 140
Switch Statements 142
Clean Functions: A Deeper Look 144
Conclusion 157
Chapter 8: Function Heuristics 159
Function Arguments 159
Command Query Separation 164
Prefer Exceptions to Returning Errol³Ü