Tolerance gets taught as a number on a drawing. In practice it’s a habit.
When you spec a part to ±0.02 mm, you’re not just picking a value — you’re making a whole chain of decisions: which machine, which tool, which workholding, how many passes, in what order. The tolerance doesn’t live on the print; it lives in every choice you made to satisfy it.
Code is the same. A function’s “tolerance” is its type signature, its contract, the inputs it promises to handle and the states it promises not to enter. Loose types, like loose tolerances, buy you speed now and cost you later — in debugging, in rework, in parts that don’t fit.
A few rules I keep
- State the tolerance before you pick the tool. Know what you’re aiming for before you decide how to get there.
- The last decimal is the expensive one. Going from ±0.1 to ±0.05 is cheap. Going from ±0.02 to ±0.01 can double your cycle time. Same in code: the jump from “works” to “provably correct” is where the effort lives.
- Respect the material. A type system, like an alloy, has opinions about what you can do with it. Fight it and you lose; work with it and it carries weight for you.
Precision isn’t perfectionism. It’s knowing which dimensions matter and spending your attention there.