Skip to content

Glossary: Software Design Patterns

Magic number

Also written: magic numbers

A number in code with no name saying what it means, like `75` and `0.85` in the old `place_order`. The fix is a named constant such as `FREE_SHIPPING_AT`.

Where the book teaches it

Related terms

Anti-pattern