C++ developers held their breath for a lean C++26. Something to cut through the language’s infamous cruft, maybe build on C++20’s modules without piling on more syntax soup. Nope. The ISO committee just rubber-stamped the standard in London, Contracts and all—despite Bjarne Stroustrup, the guy’s who invented C++, yelling from the rooftops that it’s a bad idea.
Herb Sutter, committee bigwig, calls it the most compelling release since C++11. Bold claim. Contracts slid in anyway, 114-12 vote. Stroustrup and a dozen others voted no. Abstentions? Three fence-sitters.
What Even Are These Contracts?
Think preconditions, postconditions on functions. Assertions baked right into code. Supposed to make C++ safer, catch bugs early—like training wheels for memory management. History’s long: C++20 draft had ‘em, yanked in 2019 after redesign drama. Now back as a ‘minimum viable product.’ Gaps galore—no virtual functions yet. Future-proofing, they say.
Sutter’s all in, gushing at CppCon about the ‘joy’ of C++26 contracts. Joy? Really?
But Stroustrup? Not buying it.
“It’s claimed to be a minimal viable product. It’s not minimal, it’s not viable.”
He dropped that bomb last year. Says it’ll add obscure complexity, tweak code meaning by context. Recommends skipping it entirely. “I worry a lot about the complexity, I worry about whether we can use it correctly.”
Look. Stroustrup’s no Luddite—he pushed templates, STL. But he’s got form calling out his own language’s bloat. Exceptions? He regrets those now. Contracts feel like déjà vu: Eiffel-style promises shoehorned into C++, promising safety but delivering footguns.
Why Did Stroustrup Fight Contracts?
Simple. It’s not ready. Changes code semantics sneakily—precondition fails, program halts or whatever runtime you pick. Obscure? Check. Viable for real codebases? Doubt it. He sees it twisting C++’s ‘you don’t pay for what you don’t use’ mantra into knots.
Committee pushed anyway. Sutter admits ‘smart and respected’ folks share the tech concerns. But majority rules. C++ ships every three years—next up, C++29 scheduling already locked.
And here’s my hot take, one you won’t find in Sutter’s cheerleading: this mirrors the RAII wars of the ’90s. Back then, folks fought over resource management; C++ won by keeping it lightweight, deterministic. Contracts? They’re RAII’s bloated cousin—promising guarantees but layering on compile-time checks that could bloat binaries or confuse optimizers. Predict this: in five years, Stroustrup’s proven right, and we’re deprecating half of it in C++32.
Short para for punch: Risky bet.
C++26 ain’t just Contracts, though. Compile-time reflection lands—zero runtime cost, unlike Java’s runtime navel-gazing. Sutter dubs it C++’s most powerful abstraction engine ever. Fair. Inspect code at compile time, generate boilerplate? Chef’s kiss for metaprogramming wizards.
Memory safety tweaks too. Uninitialized reads? Now defined as erroneous, not UB black magic. Google’s impl already nuked a thousand bugs, slashed segfaults 30%. Library’s hardened. Progress.
Then std::execution for async. Powerful framework—but Sutter warns it’s a pain. Shoddy docs, incomplete libs. Harder than most.
Is C++26 Actually Better Than C++23?
C++23 was modules-focused, coroutine-lite. 26 amps it up: Contracts (controversial), reflection (huge), execution (tricky), safety wins. Sutter’s ‘most compelling since 11’? C++11 had lambdas, auto, threads—paradigm shift. 26 feels iterative, Contracts the wild card.
Expectations? Devs wanted stability post-C++20 shipwreck. Contracts drag it back into feature-fight hell. Changes everything? Nah. Nudges C++ toward safer, reflective future—but at what cost? Stroustrup’s dissent lingers like a bad compile error.
Corporate spin? WG21’s no corp, but Sutter’s Microsoft ties shine through. He’s contracts evangelist—coincidence? Smells like pushing ahead to claim victory, damn the doubters.
Wander a bit: Remember concepts in C++20? Hyped, then meh adoption. Contracts could join that club. Or blow up like constexpr did—game-changer once compilers caught up.
Three words: Watch. Closely. Now.
Implementation race starts post-international ballot. Compilers like GCC, Clang, MSVC will trickle it in. Google’s lib fixes hint at real wins elsewhere. But Contracts? Opt-in hell, probably.
Dry humor time: Stroustrup inventing C++ to fix C’s warts, now fixing C++’s with more syntax. Poetry.
The Road to C++29
Work’s underway. More safety? Bet. Execution polish? Needed. Contracts evolution—virtuals, maybe. But Stroustrup’s voice? It’ll echo. Committee ignored him once; won’t twice if it flops.
Dev advice: Prototype Contracts. See if ‘joy’ hits or just headaches. Reflection? Dive in—that’s the gem.
Big picture. C++ endures because it evolves—grudgingly. 26 proves it: progress over perfection. But heeding creators? Priceless.
Long para wrap: Amid AI agents rewriting code (JetBrains, Mozilla chatter), C++26 arms humans with tools to audit the machines—reflection to peek under hoods, contracts to enforce invariants agents might gloss. Irony? Stroustrup frets complexity while AI promises to hide it. We’ll need his skepticism more than ever, as agentic dev blurs lines between writing and verifying.
🧬 Related Insights
- Read more: Open Banking’s Clunk for Humans, Gold for AI Agents
- Read more: GitLab’s Sneaky Fast-Track for AI Agents to Google Cloud—But Who’s Cashing In?
Frequently Asked Questions
What are C++26 Contracts?
Pre/postconditions and assertions on functions to boost safety—think runtime checks without full runtime.
Why did Bjarne Stroustrup oppose C++26 Contracts?
Calls it non-minimal, non-viable; adds obscure complexity, changes code meaning contextually.
When does C++26 release?
Post-ballot, implementations rolling out 2026—compilers first, full standard soon after.