← Bookmarks 📄 Article

Stroustrup's Rule • Buttondown

Programming languages face an inevitable tension: beginners need explicit syntax to build mental models, experts want terse notation to reduce clutter—and it's often the same people demanding both at different stages, creating languages that naturally evolve toward expert-friendliness over time.

· software engineering
Read Original
Summary used for search

• Stroustrup's Rule: new features demand LOUD explicit syntax, established features want terse notation—driven by mental model development, not just preference
• Rust's error handling evolution (verbose match → try! macro → ? operator) shows this progression; Python's walrus operator drama shows the conflict between expert elegance and beginner accessibility
• Languages naturally bloat as communities mature because the expert-to-beginner ratio shifts, making syntax optimization favor experienced users
• Even teaching requires fighting this instinct—the terse notation easiest for experts to read is worst for beginners (example: TLA+ function sets vs explicit quantifiers)
• The pattern extends to naming: experienced programmers prefer user_id over user_identifier for the same reason

Bjarne Stroustrup identified a fundamental pattern in syntax design: people insist on explicit, verbose syntax for unfamiliar features but demand terse notation once those features become established. This isn't arbitrary preference—it's rooted in mental model development. 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 noise that slows comprehension.

The rule manifests in concrete language evolution. Rust started with verbose match statements for error handling, added the try! macro for familiarity, then introduced the ? operator for experts. Python's walrus operator (:=) sparked controversy precisely because experts valued the elegance while teachers and beginners opposed the added complexity. The same person who needs explicit syntax as a beginner will demand terse notation as an expert—creating an inherent tension in language design.

This dynamic operates at the community level too. Early in a language's life, everyone's a beginner, so explicit syntax dominates. As the expert-to-beginner ratio shifts, languages naturally evolve toward expert-friendly features, potentially making them harder to learn. The author notes this even affects teaching: in TLA+, the expert-preferred function set notation ([Workers -> Nat]) is more elegant than explicit quantification, but beginners need the "bad" verbose version to understand what's actually being tested. Understanding this pattern helps explain why languages bloat over time and why syntax debates are really about which cognitive stage you're optimizing for.