r/cpp • u/claimred • Apr 20 '26
Software taketh away faster than hardware giveth: Why C++ programmers keep growing fast despite competition, safety, and AI
https://herbsutter.com/2025/12/30/software-taketh-away-faster-than-hardware-giveth-why-c-programmers-keep-growing-fast-despite-competition-safety-and-ai/Refreshing take by Herb. Slides here
228
Upvotes
77
u/drykarma Apr 20 '26
Always great to hear from Herb
From a newly graduate's (albeit limited) perspective, I think there's a shortage of new C++ programmers. I look around and there's very few students/new grads doing C++, it's mostly web/ml/ai/python/ds work but put C++ in the skills section because they used it in a class once. Even among the rare Rust enthusiasts among students, it seems like it's being used like a lower level Python, not as a C++ replacement for lower level paradigms.
21
u/azswcowboy Apr 20 '26
There’s a lot of issues with the statistics that got c++ lumped into the pot with C as unsafe, but there’s also issues with this rebuttal. As an example, the safety stats are coming from analytics on web browsers (google, Microsoft, Apple) - basically the modern OS that runs everywhere. That software as deployed today is almost exclusively some combination of C/C++ in the core. So from a practical point of view it’s essentially impossible to separate the two languages. The browsers run in the most hostile environment possible - on machines that can be infected and target browsers.
So everything about the measured numbers is biased as compared to other languages. But this bias doesn’t matter because thought leaders have decided to start replacing C/C++ with Rust or other memory safe languages. Which leads to events like a shortage of programmers to work on compilers and tooling that might close the security holes. This has for sure happened.
As for Herb’s numbers, I’d take the 2018 data with a huge grain of salt. Eight years is an eternity, and more importantly, for those numbers to be meaningful we’d really need to understand trends over time. After all that’s his thesis here: that actually Apple and Google have already used the early versions of the hardened standard library to help close thousands bounds check bugs that were lurking and so the CVE landscape has shifted to non programming language attacks. So we should see that in updated 2025 numbers if true.
Meanwhile Anthropic has created Mythos which is ‘too dangerous to release’. Quoting scientific American
Anthropic has shared this with the companies involved, but if nothing else, it demonstrates that the problem is still there and can now potentially be weaponized at scale. Maybe the result will be that Anthropic does the world a solid and they all get fixed - we’ll see.
https://www.scientificamerican.com/article/what-is-mythos-and-why-are-experts-worried-about-anthropics-ai-model/
34
u/vI--_--Iv Apr 20 '26
"Native code wastes less power to generate AI slop, yay" is a rather weird flex... But we have what we have.
5
u/MT4K Apr 20 '26
My English got better today.
18
u/pjmlp Apr 20 '26 edited Apr 20 '26
While progress has been made, talking about C++26 as the solution, when the main compiler used on 80% of the desktop market and a major games console is still catching up with C++23, is not something that will get sorted out in 2026.
And yes, while C inherited flaws are to blame in most cases, I keep seeing C style programming on C++ projects, even those that assert being "modern", I quickly track down uses of the C string and memory headers, strings, malloc()/free(),...
He also seems to forget that most of those AI workloads, even if implemented in C++, are running on the cloud on top of Linux kernel, making use of C, and Rust infrastructure (AWS/Azure), thus I am not sure if playing the card of being the language the upper layers use is that good.
Additionally, NVidia, AMD and Intel are adding Python JIT support to CUDA, oneAPI and ROCm, Julia and Mojo are also seeing increasing adoption from those vendors. While all those efforts depend on MLIR and LLVM, thus written in C++, I am not sure if patting on the back for being reduced to a toolchain runtime is that much of a victory.
4
u/zeno Apr 20 '26 edited Apr 20 '26
This presentation talks a lot about safety. In theory, using the latest C++ standards and best practices on green field development without the use of established (and vulnerable) 3rd party libraries would lead to more safety, but in practice, most C++ development is maintenance of existing code that integrates vulnerable but mature libraries, and outdated-standards compilers. Part of C++'s strengths, its backwards compatibility, is also an extreme weakness because code that has been running 20+ years on critical systems cannot be so easily updated or its vulnerabilities remediated. When it comes to green-field development, there's a lot of choice out there and C++ is a non starter in application development for many reasons unless performance is business-critical or the project requires deep integration with existing C-based hardware abstractions. This is the elephant in the room that should be addressed while championing C++ for modern safety.
3
u/matthieum Apr 20 '26
Yes, and no?
I think there's an argument to be made that chips have stalled as well.
Once upon time, every new generation of CPUs would boast higher frequencies. The first 5GHz CPU was unveiled circa 20131 and 13 years later we're still roughly stuck at that speed.
Chip makers have been improving single-core performance despite the frequency stall, by various means, but there's only so much they can do.
And thus, for all the workloads that are not trivially parallelizable, we've for now reached some kind of performance plateau.
1 From a quick Google search.
2
u/remy_porter Apr 20 '26
I thought I kept growing fast because I keep raiding the snacks in the break room.
2
u/BusEquivalent9605 Apr 20 '26
I just think it’s neat!
0
u/positivcheg Apr 20 '26
Yeah, nice article. I believe those Rust cultists need to be reminded sometimes that summing up C and C++ vulnerabilities is a very very bad move from their side as they love such argument.
I’ve been in C# world for 3 years but finally returning back to C++ and gonna jump on C++20 project. Happy to be back as I really missed lots of things that are C++ built-in.
1
u/Unhappy_Play4699 Apr 23 '26
While I do agree that most reports are misleading and that C is the problem child, C++ has 2 prevalent issues, imo:
Herb knows about all of this. And yet, while briefly mentioning UB improvements for C++26, he ignores most of the rest. Why? Because he also knows that these issues will not be solved, due to stubborn, old men. Note that nothing I have mentioned is implementation detail, it's the direct responsibility of the committee.
This is a marketing post. While it is good to see that a big name tries to fight the massive bashing C++ currently receives, this article still falls short representing the reality of things - the design of the language is outdated and no one wants to change this.
1
u/MarcoGreek Apr 21 '26
I don't think slowing down is the answer. MSVC was doing any language progress for some years. That is a priority, not a language problem.
Slowing down would only give that management more excuses to invest less. And if you look at C++ 20 the most complex feature is modules. Modules are complicated. It got more complicated because features like header units were added. And then there is the missing cooperation of compiler vendors.
10
u/[deleted] Apr 20 '26 edited Aug 04 '26
[removed] — view removed comment