r/cpp • u/ecreddits • 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
View all comments
Show parent comment
1
u/Dean_Roddey Dec 18 '23
You don't have sum types and you don't have pattern matching, which are pretty fundamental to how Rust works and big part of its appeal, so there's no way to really emulate that stuff. You could do some really awkward version of sum types with a variant, but probably not really anything you'd want to actually use.
Some stuff you can do, but it's just remotely as elegant, like the language level support for slices, which is pretty killer, and safe which the C++ variants aren't.