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.
Recommended for people wanting to improve their object-oriented coding skills, especially in Ruby. There are now editions available with code examples in PHP and Javascript as well, and the beverage can be beer or milk. Now I’m curious to see their code that generates the different versions of the book!
Leave a Reply