Working with Legacy Code
You should read: Working with Legacy Code by Michael Feathers
At some point (or at many points) we have to work with legacy code. It's always a brutal struggle, but it doesn't need to be.
If you were to ask me what books have impacted my life as a Software Engineer, I may mention a handful I've enjoyed but this one has had me floored.
Many books teach you languages, algorithms, structures, patterns. This book teaches you how to *think* (and if you read it early in your career, you won't have to learn it all through painful experiences like I had to.)
Two paraphrased quotes I love:
- "When a class has too many responsibilities, chances are, you'll have an incredible number of reasons to change it."
- "If you have the urge to unit test a private method, that method should be public. If it feels weird for that method to be public, it should probably be in its own class."