Skip to content

Glossary: Software Design Patterns in Go

Magic number

Also written: magic numbers

A number in code with no name to say what it means, such as `75` and `0.85` in the old `placeOrder`. Give it a named constant like `freeShippingAt`.

Where the book teaches it

Related terms

Anti-pattern