Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Saturday, January 13, 2007

Better Names for Martin Fowler's "Refactoring Smells"

Cover of Refactoring

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 NameNew Name
Alternative Classes with Different InterfacesHeterogeneous Interfaces
Comments
Data Class
Data Clumps
Divergent ChangeSchizophrenic Class
Duplicated Code
Feature EnvySatellite Method
Inappropriate IntimacyInternal Access
Incomplete Library Class
Large Class
Lazy ClassSmall Class
Long Method
Long Parameter List
Message ChainsTemporary Variables
Middle ManOverdelegation
Parallel Inheritance Hierarchies
Primitive ObsessionProcedural Code
Refused BequestWeak Inheritance
Shotgun Surgery?
Speculative GeneralityOverdesign
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?

5 Comments:

  • your suggestions are confusing. don't attempt to sound clever - the Fowlers names are crystal clear, and your names are opaque.

    By Anonymous Anonymous, at 1/13/2007 2:59 a.m.  

  • Possibility for Shotgun Surgery: Widespread Modification

    By Blogger Jonathan, at 1/13/2007 1:30 p.m.  

  • I find "code smell" a little unpleasant so I know where you are coming from. But I _like_ "feature envy" and a few of the others. They give a flavour of the problem at least as well as or perhaps better than a straightforward description of the problem. "Small Class" isn't immediately a problem, but a "Lazy Class" is (it doesn't do enough, right, and I last picked that book up in about 2001 so that isn't from memory).

    By Blogger Thomas David Baker, at 1/13/2007 4:12 p.m.  

  • bakert - Yeah, I kind of like Shotgun Surgery myself.

    By Blogger Jonathan, at 1/13/2007 5:21 p.m.  

  • Perhaps "Tiny Class" instead of "Small Class"? I'm not in favour of "Lazy Class" because lazy has several connotations (notably "delayed").

    By Blogger Jonathan, at 1/13/2007 5:23 p.m.  

Post a Comment

<< Home