magic number
noun
- An unexplained literal value in code whose meaning is known only to whoever wrote it. Replacing
if (retries > 7)withMAX_RETRIESturned a magic number into a decision someone can find and change.
In plain words
- random numbers in the code
- what does this 86400 mean
- hardcoded values with no explanation
- unexplained constant
See also code smell Chesterton's fence