I delivered a keynote, C++ and the Next 30 Years, at the 2024 CPP-Summit conference in Beijing, China. Experiencing the culture, the people, and the landscape was tremendous. In this post I’ll cover some of the points in my future-looking C++ talk and share my experience giving a talk for the first time in China.
The title of my keynote was C++ and the Next 30 Years which covered C++’s evolution, the changing landscape of programming languages, and the influence of AI. Here I break down some of my talk’s key points.
The next 10 years
In the next 10 years I expect C++ modules to become more accessible. Most C++ vendors have at least some support and CMake recently announced its feature set. However, transitioning existing code bases and, in many instances, bespoke build systems will be a great obstacle.
Package manager usage is on the rise, but the growth curve is slow. I don’t expect any tool to capture more than 40% market share by the decade’s end.
In the C++ feature department, we can expect static reflection, pattern matching, contracts, and sender/receiver to become available over the next decade.
AI-assisted coding is following the well-trodden Gartner hype cycle where inflated expectations precede an ultimate plateau of productivity. While we’re thankfully past the idea that AI-backed productivity gains will result in massive Software Engineering workforce reductions, I don’t think it is yet clear to what extent AI will improve software development productivity.
Another major factor over the next 10 years will be the growing usage of Rust by C++ developers. The following graph illustrates the increasing percentage of C++ users that also use Rust based on data from StackOverflow annual surveys. A conservative linear projection results in 50% of C++ developers also using Rust in 10 years.
C++ in 10 to 20 years
C++’s complexity is increasing, and the impact on training costs and attractiveness to new developers will be especially apparent in 10–20 years. Compare a snippet of C++11 code to a potential equivalent in C++32:
#include <iostream>class C {
std::string j;
};
std::ostream& operator<<(std::ostream&os,
const C &c) {
return os << j;
}
import std; // Modules, something to know in addition to #include// Metaclasses feature?
class(propagate_allocator) C {
std::pmr2::string j; // Another std::string vocabulary type?
};
// Formatters are preferred to stream operators since C++20
template <>
struct std::formatter<C> {
constexpr auto parse(
std::format_parse_context& ctx) {
return ctx.begin();
}
auto format(const C& x,
std::format_context& ctx) const {
return std::format_to(ctx.out(), "{}", x.j);
}
};
And this doesn’t even touch on the complexity of concepts, constexpr, contracts, and other features.
One might wonder if today’s C++ successor hopefuls — Hylo, Swift, Cpp2, Carbon, Zig, Mojo, and Rust — will gain more traction at this time. Swift and Rust are likely to remain due to the world’s existing dependence on them. For the others, to achieve significant adoption they’ll need something like 10 years of continuous investment. Unfortunately, difficulties maintaining momentum makes success unlikely (See The Economics of Programming Languages by Evan Czaplicki).
C++ will remain important in niches, companies with large existing C++ code bases, and surrounding software assets no one wants to rewrite. For the latter, consider the continued popularity of LAPACK, a useful and sophisticated linear algebra package, long after its Fortran programming language lost favor.
In the 10–20 year timeframe a few industry shifts will start to take hold. First, memory safety legislation will make usage of C and C++ for new projects require special justification and oversight. Safety-critical applications will see C++ entirely phased out. Second, software engineering as an engineering discipline will mature with regulatory oversight, inspections, and enforcement of best practices becoming commonplace. Finally, on the application side, AI will become the dominant form of human-computer interaction.
C++ in 20 to 30 years
This period is difficult to predict, but the world will likely remain highly dependent on complicated and memory-unsafe C++. However, rather than people, AI will be doing most of the coding; it will find and fix defects and we’ll trust it to do so. While rewriting C++ code into a more suitable programming language may be proposed, such efforts will be deemed risky and expensive. C++ will live on like the imperial measurement system in the USA.
At first glance, CPP-Summit looked like any other C++ conference: you’ve got vendor booths, conference rooms, swag, etc. A notable difference was a curious tray of electronic devices lingering on a table. As I came to find out, those were earpieces that transmit live translations of English-speaking presenters. As a speaker, I also made use of one to hear audience questions on a panel.
As a speaker from another country, I couldn’t have been better taken care of. I was offered accompaniment at meals, a guide to show me the sites in Beijing, and even some small souvenirs to give my kids when I returned. I’m incredibly grateful to Jason Li, Raymond, Yongwei Wu, and Li Monan for being such gracious hosts.
I learned that it’s still relatively rare for folks from other countries to give talks in China and many even wanted photographs of me to mark the occasion. Below is a photograph of myself with Yanfei Zhang, a Chinese book author.
The one challenge I encountered was the Great Firewall, which blocks access to staples such as Google, GMail, and Slack. While this meant no Wikipedia (right when I needed it the most — to learn more about China!) I came to see lack of email access as a positive; more time to focus on the conference itself.
It was interesting to learn about the Chinese Software Developer Network (CSDN), China’s most popular developer portal. It provides a Github alternative (gitcode.com), a cloud-development platform (InsCode), a code-generating AI bot (so.csdn.net), and much more. I also had the pleasure of meeting CSDN’s founder, Jiang Tao.
In this post I’ve talked about speaking in China and outlined the content of my C++ and the Next 30 Years talk. Speaking at the conference was of great cultural interest, and ruminating on the future of C++ is fun in any context 🙂
Learn more about C++ at Adobe including training, events, and careers.