Why Design by Contract Never Took Off
Bertrand Meyer introduced Design by Contract in 1986 with Eiffel, offering software engineering a formal system where correctness was structural, not aspirational. Preconditions declared what a function required, postconditions guaranteed what it delivered, and invariants ensured objects never entered invalid states. The methodology was mathematically sound and immediately trapped behind a trademark and an expensive IDE license. While Java spread through Sun's marketing muscle and free JDK downloads, Eiffel required commercial licensing. The industry absorbed Meyer's ideas piecemeal: C#'s Code Contracts as optional attributes, D's built-in contract syntax that hardly nobody uses, Python's icontract decorators that remain niche.
The gap between promise and delivery explains the failure. Runtime contracts check conditions during execution and crash when violated. When Eiffel Software claims Design by Contract provides "guarantees that software will not enter invalid states," the language implies prevention. What runtime contracts actually deliver is detection: the program enters the invalid state, detects the violation, and terminates. This is better than silent corruption but it isn't prevention. When the November 2025 Cloudflare outage occurred (a Rust .unwrap() panic) Eiffel Software claimed contracts would have prevented it. The contract would have crashed identically. Meyer himself recognized this limitation and developed AutoProof at ETH Zurich, proving Eiffel contracts statically using formal verification. AutoProof won academic awards but never achieved commercial adoption, demonstrating that compile-time proof is technically feasible but economically viable only for safety-critical systems where regulatory frameworks mandate it.
The industry chose resilience over prevention: supervision trees that restart failed processes, chaos engineering that injects deliberate failures, microservices with circuit breakers. When deployment cycles measure in minutes, most organizations invest in comprehensive testing and rapid recovery rather than formal methods for code that changes monthly. Contracts are code. When requirements evolve, contracts need updates. Every contract represents another artifact to synchronize with reality. The maintenance burden doesn't justify the debugging benefit for most domains. By 2025, Design by Contract exists primarily as academic tooling (Racket's contract system, experimental Rust crates) and historical reference in programming language courses. The methodology works in the narrow sense that explicit contracts improve code clarity. It failed because it was marketed as prevention while delivering detection, and because an industry optimizing for velocity chose tools that acknowledged failure as inevitable rather than tools claiming to eliminate it through correctness.