Part I. Tidyings
My general learning strategy is to go from concrete to abstract. Therefore, we’ll start with a catalog of little design “moves” you can make when faced with messy code you have to change.
Those of you familiar with refactoring will see great similarity between refactorings, defined as changes to structure that don’t change behavior, and tidyings. Tidyings are a subset of refactorings. Tidyings are the cute, fuzzy little refactorings that nobody could possibly hate on.
“Refactoring” took fatal damage when folks started using it to refer to long pauses in feature development. They even eliminated the “that don’t change behavior” clause, so “refactoring” could easily break the system. Let’s see: no new features, possible damage, and nothing to show for it at the end. No thank you.
In Part II, we’ll talk about how to integrate tidyings into a development workflow. For the moment, read, learn, and apply these tricks that will add joy to your next minutes of development.