Magic Number
Version 1.0.0 · Updated 2026-07-30
CORE DEFINITION
Refers to specific numbers used directly in code without explanation of their meaning (e.g., if x > 30). Good practice is to define numbers as meaningful constants (e.g., MAX_USER_LIMIT = 30).
SCAFFOLDING EFFECT
Reduce cognitive load
Enhance explicitness. In work and life, do not throw out conclusions without context (magic numbers), but explain the underlying logic and definitions (constant names). This greatly reduces the cost of understanding and maintenance for others.
Anchor fast decisions
The 'magic number' most commonly refers to Miller's (1956) finding that human working memory can hold about 7±2 chunks at once. Another meaning is the particularly stable proton/neutron numbers in nuclear physics (2, 8, 20...). Both refer to 'a number that happens to be critical'.
MINIMUM ACTION
In progress 0/3Practice this model in one real situation:
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more
Source support: Explicit
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Magic_numberverified
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