Recent
Making Invalid States Unrepresentable 1: Why boolean flags are bugs in disguise
·5 mins
A traffic light that is red and green at the same time. A user who is logged in and logged out simultaneously. Boolean flags make these absurd states perfectly representable, and that is the problem.
Making Invalid States Unrepresentable 2: The algebra behind your types
·7 mins
Types are called algebraic because they obey arithmetic. Product types multiply, sum types add. Understanding this arithmetic explains why an enum with 5 variants is infinitely more precise than 4 boolean flags.
Making Invalid States Unrepresentable 3: Real bugs from representable nonsense
·6 mins
Null references, UI loading spinners that show errors and data simultaneously, payments that are captured and voided at the same time. These are not hypotheticals. They are the direct consequence of types that lie about the domain.
Ownership in Rust 1. Stop fearing .clone() — what the borrow checker is not telling you
·7 mins
The Rust community treats .clone() like a code smell. Sometimes it is. But most of the time, the instinct to avoid it costs more in complexity than the clone costs in nanoseconds. We dissect what clone actually does for every common type, the real cost spectrum across six orders of magnitude, and why Clone and Copy are not the same conversation.
Ownership in Rust 2. Six ways to share state — and how to pick the right one
·9 mins
Move, borrow, clone, Rc, Arc, Cow. Rust gives you six lightsaber forms for ownership. Each one counters a specific threat. Using the wrong form against the wrong opponent is not just inelegant — it is fatal. We map each strategy to the situations where it excels and where it fails catastrophically.