
Martin Fowler's
Refactoring (1999) is a landmark book for software engineering. It is a catalog of techniques for cleaning up code. Unfortunately, this remarkable book is tarnished by some frivolous names chosen for its list of "refactoring smells" (anti-patterns). Unlike the memorable pattern names from that other luminous book
Design Patterns (1995) โ Singleton, Observer, Visitor, etc. โ the anti-pattern names in
Refactoring sometimes degenerate into the ludicrous: Feature Envy, Inappropriate Intimacy, Primitive Obsession, Speculative Generality, ...
The worst part is that these names give little clue as to what they mean.
I would like to propose alternative names for some of Fowler's "refactoring smells". Many of the names are fine as is, but a number of them benefit from sober clarity of expression:
| Old Name | New Name |
|---|
| Alternative Classes with Different Interfaces | Heterogeneous Interfaces |
| Comments |
|
| Data Class |
|
| Data Clumps |
|
| Divergent Change | Schizophrenic Class |
| Duplicated Code |
|
| Feature Envy | Satellite Method |
| Inappropriate Intimacy | Internal Access |
| Incomplete Library Class |
|
| Large Class |
|
| Lazy Class | Small Class |
| Long Method |
|
| Long Parameter List |
|
| Message Chains | Temporary Variables |
| Middle Man | Overdelegation |
| Parallel Inheritance Hierarchies |
|
| Primitive Obsession | Procedural Code |
| Refused Bequest | Weak Inheritance |
| Shotgun Surgery | ? |
| Speculative Generality | Overdesign |
| Switch Statements |
|
| Temporary Field |
|
I would also like to improve on "Shotgun Surgery" (in which a modification involves touching code in several places), but I cannot think of an apt name. Any suggestions?