On Invariants.
What is an invariant?
4 min readMay 10, 2019
- The specification of a program should be its class invariants
- Aim to write programs so that you cannot create invalid objects or data.
I’ll use Rust as the language to describe the concepts behind this post, but try to make it accessible to those using other languages.