Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M1313

Magic Number

Magic Number
Learn & MetacognitionHigh supportCognitive Science
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

A specific numeric literal used directly in code without explaining its meaning, such as if x > 30.

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). Scaffold use: 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.

How to use

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.

Mechanism

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'.

Practice

In progress 0/3

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • Phone numbers segmented, menus around seven items are easier to remember; closed shells in nuclear structure.

Common pitfalls

  • Treating 7±2 as a precise upper limit—actually greatly affected by chunking and familiarity; capacity varies across tasks.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    en.wikipedia.orghttps://en.wikipedia.org/wiki/Magic_numberZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS