Skip to content
slang.fyi

code smell

/koʊd smɛl/

Common

A sign in the code that something is probably wrong, even if it works.

It's a heuristic, not a rule. Some code smells are acceptable tradeoffs. The term comes from the intuition that bad code 'smells' before it breaks.

Real-world examples4 examples
#ExampleWhat it meansSource
01the function takes a boolean flag to change its behavior. huge code smell.Passing a boolean to change what a function does is a classic sign the function should be split.x, 2023
02there are 47 commented-out lines and nobody knows why. code smell.Dead code left in place is a sign the codebase lacks discipline and will accumulate confusion.reddit, 2024
03whenever I see a class called 'Utils' I know it's a code smell. it means nobody thought about design.Catch-all utility classes signal that code organization was avoided rather than done.x, 2024
04left a comment in the PR: 'this works but it smells, we should revisit before v2'Acknowledging a code smell without blocking the current PR, but flagging it for later.x, 2023

Use it when

  • Code review where something looks suspicious but isn't clearly broken.
  • Flagging a design pattern that tends to cause problems over time.
  • Teaching a junior dev to recognize warning signs in code.

Do not use it when

  • You found an actual bug.Use “bug” instead.
  • You just don't like the style choice.
  • The code is slow.Use “performance issue” instead.

Origin and context

Popularized by Martin Fowler in his 1999 book 'Refactoring.' The metaphor of smell captures the intuition that something is wrong before you can formally prove it.

First seen
1990s
Confidence
high

Cite this page

Use this stable URL to reference the entry.

https://slang.fyi/code-smell
Updated: 2026-08-28License: CC BY 4.0

Related slang