What does "magic number" mean in programming?
magic number is one of the most common terms in software development. This guide explains what it means, how it is used in practice, and why it matters, with real examples from the developer world.
Definition
A numeric literal in code that has no explanation for why that specific value was chosen. Magic numbers make code hard to understand and maintain because the meaning behind the number is not self-evident.
Example
"What does the 86400 in this condition mean? Replace magic numbers with named constants like SECONDS_PER_DAY."
Related terms
Ready to practice your English at work?
Lingua-e has interactive exercises built around real developer conversations: standups, code reviews, retrospectives, and more. Practice until it comes naturally.
Try Lingua-e for free