Want to see the full-length video right now for free?Sign In with GitHub for Free Access
In this episode, Joe and Ben discuss a fairly advanced example of refactoring.
You'll dive into the good, the bad, and the ugly of code before and after being rewritten. The new code uses a number of design patterns, including the Builder pattern, the Chain of Responsibility pattern, the Null Object pattern, and the Decorator pattern. It also combines object-oriented object composition with functional style recursion using inject.
If you'd like to see more examples of this type of refactoring, check out Ruby Science.