Matias Leidemer
Published on

Review: 99 Bottles of OOP

I’ve just finished reading 99 Bottles of OOP by Sandi Metz, and, just like her other book (which I reviewed in Portuguese), it’s a very good read.

If you’re into Object-Oriented Programming and you don’t know Sandi, you’re doing it wrong. She’s a very famous OO advocate and has given a lot of talks on the subject. The one at the Railsconf 2014 is one of my favorites.

Now, back to 99 OOP. The book guides the reader through a refactoring of the 99 Bottles of Beer song. It also introduces a new requirement and how to change your code in order fit it in.

Along the way she explains a lot about techniques to make your refactoring easier to follow, always taking advantage of the test suite and changing only a single line before running the tests again. This, with some other techniques to make refactoring safer, is called by her as “The Flocking Rules”. It may sound a little too much sometimes, but it makes perfect sense throughout the book. Techniques and tools to analyze code complexity are also presented.

She also talks a lot about the Liskov substitution principle and, especially, about the open/closed principle, which was very enlightening, making for a bunch of “aha moments”. There’s also a very nice topic where she explains why inheritance is good instead of bad.

Like her other book, I really recommend this one. I’m very sure you’re gonna become a better software developer after reading it.