Antipatterns Overview

Antipatterns are common solutions to common problems where the solution is ineffective and may result in flawed or counterproductive results.

Table of Contents

Bloaters

Code, methods, and classes that have grown to massive proportions.

Object-Orientation Abusers

Incomplete or incorrect application of OO principles.

Change Preventers

Structural issues that make modification difficult.

Couplers

Excessive coupling between classes.

Dispensables

Pointless or unneeded code.

  • Comments: Comments that explain “what” or “how” instead of “why”.
  • Duplicate Code: Identical or very similar code exists in more than one location.
  • Lazy Class: A class that doesn’t do enough to justify existence.
  • Data Class: Classes with fields, getters/setters, and nothing else.
  • Dead Code: Unused variables, params, methods, files.
  • Speculative Generality: Building for future requirements that may never come.
  • Boat Anchor: Unused code kept “just in case”.

Implementation & Cognitive Load

Smells that make code hard to read or reason about.

Stability & Reliability

Patterns that lead to bugs.

Architecture Smells

Design issues at the system level.

Unit Test Smells

Issues in test code.