iteration

Bad Smells in Code

Episode Summary

This week we talk about long functions, long parameter list, global and mutable data.

Episode Notes

Chapter 3 - Bad Smells in Code

The theme of this chapter: just because you know how to refactor, doesn't mean you know when. This chapter talks about the when.

One thing we won't try to give you is precise criteria for when a refactoring is overdue. In our experience, no set of metrics rivals informed human intuition. What we will do is give you indications that there is trouble that can be solved by a refactoring.

Mysterious Name

Duplicated Code 🔥

Long Functions 🔥

Long Parameter List 🔥

Global Data 🔥

Mutable Data

Divergent Change ✅

Shotgun Surgery ✅

Feature Envy

Data Clumps

Primitive Obsession ✅

Repeated Switches

Loops

Speculative Generality ✅

editor choice

Message Chains

Middle Man

Insider Trading

Large Class ✅

Alternative Classes with Different Interfaces

Data Class

Refused Bequest


Picks: