Refactoring: Improving the Design of Existing Code (2nd Edition) Cover Book cover copyright Martin Fowler

Overview

This chapter explains several refactoring methods for moving code around and making it easier to clean them up.

My One Takeaway

Two this time:

  1. I love how much easier to read the “Replace Loop with Pipeline” refactoring makes the example. I think I’ll definitely be spending some time looking into how to do this with PHP.
  2. “Remove Dead Code” is my favorite refactor ever. In an earlier job, we had a functions.php that was included in every file and it had an if statement that could never resolve to true. Everyone was afraid of removing it for fear that it would break something. I wasn’t. :-)