16 — Anti-patterns¶
Driving question: When does a recurring solution become a recurring failure mode?
Learning objectives¶
- Distinguish anti-patterns from defects, smells, and disliked styles.
- Analyze the attractive short-term forces that create anti-patterns.
- Describe recovery paths rather than only naming problems.
- Recognize organizational/architectural feedback loops.
Anti-pattern anatomy¶
An anti-pattern is valuable when it explains:
- a recurring context;
- a tempting or common response;
- the negative consequences of that response;
- symptoms that reveal the problem;
- a refactored solution or recovery strategy.
Examples often discussed include Big Ball of Mud, God Object, Lava Flow, Golden Hammer, Spaghetti Code, and architecture-by-accumulation.
Why anti-patterns persist¶
They are often locally rational: deadlines reward short-term patches, ownership boundaries incentivize duplication, or frameworks make one mechanism unusually convenient. A useful recovery plan therefore considers socio-technical constraints as well as code structure.
Design / research exercise¶
For one anti-pattern, write the strongest possible argument for why a competent team would create it. Then design a staged recovery plan that does not assume a rewrite.
Suggested reading¶
- Brown et al., AntiPatterns.
- Foote & Yoder, “Big Ball of Mud.”