Book Review: Refactoring in Ruby

by woody2shoes on April 7, 2010

I recently read Refactoring in Ruby. There were several things I really liked about the book and one flaw that caused me some problems.

The first thing I liked about the book was the way it pointed out code smells and how to identify them. I found several things that really affected the way I code because I recognized that I implement several of the code smells routinely in my own code. This part of the book was very clear and in my opinion alone made it worth having.

Second, the exercises are top notch. They make you think about the code you need to refactor. They also help you visualize or actually complete the changes that need to be made to the code.

Finally, it made me think about how I implement code in the first place. This is related to the first point, but there I’m talking about the mistakes I’ve already made, or at least the smells in my existing code. In this case, I’ve already approached a couple of problems only to see that there was a better way due to the principles behind the code smells.

The only problem I had with the book was that it seemed to rely on other literature to define the solutions. It would give an explicit name for the refactoring that needed to take place, but wouldn’t explain the process. Now, in most cases, you could guess from the name what the steps for refactoring might be, but this was not always clear.

Overall, I feel like the book is a great resource if you’re looking for exercises to make your code better or if you want a compilation of common code smells in Ruby. Just make sure you’re willing to look up the refactorings that are named but not explained.

Previous post:

Next post: