Inconsistent Names

Using different words for the same concept.

“Pick one word for one abstract concept and stick with it.” – Robert C. Martin

Signs of Use (Symptoms)

  • fetchUser(), retrieveOrder(), getProduct() all do similar “get” operations.
  • Controller, Manager, Handler used interchangeably.

Why it is bad (Consequences)

  • Confusion: Are fetch and get different? Is there a subtle distinction?
  • Discoverability: Developers search for getUser but it’s fetchUser.

Why it happens (Root Cause)

Multiple developers with different vocabularies. No agreed-upon naming convention.

When it might be okay (Exceptions)

  • Technical distinction (HTTP fetch vs DB get).

Explanation

Problem

Codebase uses fetch, get, retrieve, load for the same concept.

The Flaw

Inconsistency creates cognitive overhead.

Real world analogy

Calling directions “left”, “port”, and “westward” in the same conversation.

Refactoring Solution

  • Rename Method: Standardize vocabulary.
  • Agree on glossary.

Pros and Cons (of the Antipattern)

Pros (Why people do it) Cons (The price you pay)
  • Developer freedom
  • Confusion
  • Comparison

    • Related Antipatterns: Uncommunicative Name.
    • Related Principles: Consistency.

    Code example

    Typescript

    Bad (The Antipattern)

    Good (The Fix)