Subtitle: A Practical Guide to Object-Oriented Design
Recommended to me by: Sam Livingston-Gray
This book creates and then refactors (edits to improve) code to generate the “99 Bottles of Beer” song. (When I was a kid on field trips, we started at 100 Bottles.)
I read most of this book in 2015, but didn’t finish it, so didn’t add a post for it here. Apparently the initial “Shameless Green” code (straightforward code that makes the tests succeed) stuck with me, because I mostly reproduced it in the half-hour recommended to attempt the problem before reading the rest of the book.
There are lots of great points about object-oriented design and recipes for refactoring. The Ruby code that results at the end is elegant and easy to modify, although its readability benefits from the step-by-step walkthrough to get there. I will probably refer back to the book for refactoring tips when faced with Ruby code to improve.