← Bookmarks 📄 Article

Stroustrup's Rule • Buttondown

Programming languages face an inevitable tension: beginners demand explicit syntax to build mental models, experts crave terse notation once they have them—and it's often the same people at different stages, creating a ratchet effect that makes languages harder to learn over time.

· software engineering
Read Original
Summary used for search

• Stroustrup's Rule: new features need LOUD explicit syntax, established features want terse notation—not because of different users, but because experts develop mental models that make verbosity feel like clutter
• Rust's error handling evolution (verbose match → try! → ?) and Python's walrus operator drama show this tension playing out: experts want elegance, teachers want learnability
• The rule operates at both individual level (same person's preferences change) and community level (as expert ratio grows, languages add terser syntax)
• This explains why languages inevitably bloat and become harder to learn—it's not just feature creep, it's the natural consequence of serving both beginners and experts
• Teaching requires actively resisting expert preferences: the author uses verbose TLA+ invariants for students despite preferring terse function set notation

Stroustrup's Rule captures a fundamental dynamic in programming language evolution: people demand explicit, verbose syntax for unfamiliar features but prefer terse notation for established ones. The insight isn't just about different user populations—it's that the same programmers shift preferences as they develop mental models. When you lack an internal model for a concept, you need all the explicit information you can get. Once you've internalized it, that same explicitness becomes visual clutter that slows comprehension.

The rule manifests in concrete language evolution. Rust's error handling started with verbose match statements, added the try! macro for familiarity, then introduced the cryptic ? operator once the community had internalized the pattern. Python's walrus operator (:=) sparked drama precisely because experts valued the elegance of inline assignment while teachers and beginners saw it making the language harder to learn. The tension exists at both individual level (your preferences evolve) and community level (as the expert-to-beginner ratio shifts, languages add more expert-friendly features).

This creates a ratchet effect: languages inevitably accumulate terser syntax over time, making them progressively harder for newcomers. It's not just feature bloat—it's the natural consequence of serving both populations. For teachers, this means actively working against your own expert preferences. The author gives the example of teaching TLA+ type invariants: experts prefer the elegant function set notation ([Workers -> Nat]), but beginners need the explicit universal quantification (\A w \in Workers: counter[w] >= 0) to build their mental model, even though it's more verbose.