r/cpp • • Dec 17 '23

Is C++ Really Phasing Out?

I've read a lot posts about whether C++ is still viable to learn, but a lot of the responses seem to be a long the lines of "C++ is still being used" or "there's a lot of things written in C++ still, so it will still be useful".

But a lot of these replies seem to suggest that C++ is on the downhill and in the process of being replaced with more modern languages in many industries.

It seems kind of discouraging to be learning a language that is on a decline, if it really is phasing out.

0 Upvotes

214 comments sorted by

View all comments

58

u/[deleted] Dec 17 '23

new developers feel really discouraged to learn it so it's understandable that's what it looks like, but it's extremely reliably and widely used in so many industries, it might become more specialized with time but it's not going anywhere.

33

u/Plazmatic Dec 17 '23

but it's not going anywhere.

In the sense there will always be c++ code to work on and probably always be new c++ projects? Sure. But c++ is certainly finding itself pushed out of some spaces. Defence, government, and possibly secure finance (ie not hft) are possibly going to be forced to move off of c++ via regulations. And while grandfather clauses are certainly a thing, there are very much less a thing for anybody who isn't a gov employee, ie contractors, who often have to deal with very swift turn around on new rules. that drum started to beat a couple years ago at this point, and more assertive each time it's repeated. And in those industries, it's not a matter of "old code will still be around", uncle sam is starting to demand the code be gone, not put on life support.

To a lesser extent, while C is still the primary language for embedded, for what c++ does exist there, is starting to be pushed out of embedded, and you can see how tired many embedded devs at c++ conferences vent frustration, specifically pointing to rust, at how the C++ committee is offering little to no consideration to new features under an embedded context in contrast (prime example, co-routines, and to a lesser extent how #embedd had to go through C to land in c++, though that's useful everywhere, rusts async works in embedded, and works well, it has embed, and has nostd and the package management ecosystem to support nostd packages, not to brag on it, but to illuminate just how far behind c++ is here). Rust has already proliferated in the Arm embedded market surprisingly quickly, and if it wasn't for LLVM not being able to target as many machines as other implementationd for c++, and rusts reliance on the LLVM ecosystem, you might never see another company start a codebase in c++ for embedded period.

C++ is probably going to lose in the embedded market permanently at some point, but for everything else, it's really up to the standards committee to fix many of the footguns that aren't there for speed, and adding reflection etc.

Luckily, regardless of any of this, learning c++ will never be "obsolete", because becoming skilled in c++ basically directly translates to being skilled in other languages. You can pick up Python in a weekend being an expert in C++, same goes for Java, C# and Kotlin. Rust isn't even difficult to learn comming from being an expert in c++.

0

u/[deleted] Dec 17 '23

[deleted]

6

u/germandiago Dec 17 '23

I have worked in two telco companies and another for database backend. All of them made heavy use of C++.

0

u/[deleted] Dec 18 '23

[deleted]

1

u/germandiago Nov 29 '25

One of them is from 2018 or around (the db backend one).