Briefle words · Code & architecture
Magic number
A raw number placed in code without a name or explanation, leaving readers to guess what it means.
Say it to an AI
Python late_fee(balance, days_late) returning a Decimal: 5-day grace period, 1.5% of the balance, a $25 collections fee after 30 days, capped at $40. No magic numbers: put each policy value in a named constant at module level so there is a single source of truth.
How an expert would brief the stronger version of “Loan late fee”.
See it
Try it as a puzzle →The rule that charges a late fee on an overdue loan payment in a lending app.
Why: A's 'days_late <= 5', 'Decimal("0.015")' and 'Decimal("40")' are magic numbers; nothing says 5 is a grace period or 40 is a legal cap.
Related words
Room 1 · Essentials
Learn “Magic number” in a five-minute lesson