More on this book
Community
Kindle Notes & Highlights
Read between
March 11, 2022 - February 25, 2024
A poorly designed system is hard to change—because it is difficult to figure out what to change and how these changes will interact with the existing code to get the behavior I want. And if it is hard to figure out what to change, there is a good chance that I will make mistakes and introduce bugs.
Yet as soon as someone does need to understand how that code works, and struggles to follow it, then you have to do something about it.
Whenever I do refactoring, the first step is always the same. I need to ensure I have a solid set of tests for that section of code.
This is the essence of the refactoring process: small changes and testing after each change. If I try to do too much, making a mistake will force me into a tricky debugging episode that can take a long time. Small changes, enabling a tight feedback loop, are the key to avoiding that mess.

