Skip to content

Glossary: Software Design Patterns in Rust

Magic number

Also written: magic numbers

A number written in code with no name, like `75.0` or `0.85` in the old place_order. Give it a name with a `const`.

Where the book teaches it

Related terms

Anti-patternconst