Code Smell
Updated 2026-07-30
Summary
In computer programming, a code smell is any characteristic of source code that hints at a deeper problem. Determining what a code smell is and is not is subjective, and varies by language, developer, and development methodology. The term was popularized by Kent Beck on WardsWiki in the late 1990s. …
Definition
A characteristic in code that is not superficially a bug but hints at deeper design problems (e.g., overly long functions, messy variable names). It smells 'off,' and if not addressed, it will rot into bigger problems in the future. Scaffold use: - Intuitive diagnosis: not only for code. Management also has 'smells' (e.g., meetings always without conclusions, employees avoiding eye contact). Don't wait for an accident to fix; when you smell a smell, refactor the process immediately.
Introduction
How to use
- Intuitive diagnosis: not only for code. Management also has 'smells' (e.g., meetings always without conclusions, employees avoiding eye contact). Don't wait for an accident to fix; when you smell a smell, refactor the process immediately.
Mechanism
Certain code structure characteristics (overly long functions, duplicated code, too many parameters, large classes, confusing naming) do not immediately cause failures, but they indicate fragile design, high coupling, or unclear responsibilities, which over time evolve into defects. Smells are early signals of maintainability issues, not functional bugs.
Practice
In progress 0/4Practice this model in one real situation:
Cases
- A 2000-line 'god function'; variable names like a/b/c that are hard to understand; in management, 'meetings always without conclusions, employees avoiding eye contact' as organizational smells.
Common pitfalls
- Overhauling upon smelling a smell can introduce new bugs; or completely ignoring small smells until the system rots; equating smells with bugs (though they are not functional failures).
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Code_smellverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS