In Refactoring, Kent Beck and Martin Fowler famously relate the identification of Refactoring Patterns to “bad smells” in code. They found that just because we know how to refactor doesn’t mean we know when it is best to do so. So Fowler wrote a book detailing common code anti-patterns and how to best refactor them.

I opened by stating that we’ve all read code that smells bad, to go even further, we’ve all written code that smells far worse. Through this arduous-wafting process, we can become adept at identifying these odors and work to prevent them before they start to reek. For legacy code, we can use these trends as cues to know when it is time to refactor.

The existence of any of the following anti-patterns implies that your code has yet to reach its final form and could use a little TLC-R (tender, loving, care and refactoring) to reach perfection. Keeping this list in the back of your mind while coding will reduce the need for refactorings, as you will begin to simply get it right the first time around. Plus, you’ll learn a handful of buzz-words to use during your next code review to one-up your team-mates.