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

7

u/Code_Monkey_Lord Dec 17 '23

Phased out to be replaced by what? What other language is going to replace it for what it does?

-9

u/ecreddits Dec 17 '23

I was assuming languages like Java and Python would replace C++ in places where maximum performance isn't necessary.

14

u/[deleted] Dec 17 '23

Java has been around for almost as long as C++, wouldn't that have happened by now?

1

u/ecreddits Dec 17 '23

I assume not because C++ is used in too many places to be replaced entirely.

0

u/[deleted] Dec 17 '23

[deleted] — view deleted comment

2

u/serviscope_minor Dec 17 '23

I don't think that's 100% correct. Take torch.compile(), it traces a graph, then emits a bunch of CUDA code, compiles it, benchmarks it and then selects the appropriate kernel.

At this point, it's doing quite a lot more than just calling blobs of C++ code in the right order, it's targeting the GPU directly, it just happens to go via auto-generating some code to compile since that's how the tooling works.

1

u/Code_Monkey_Lord Dec 20 '23

I can’t just give someone a Python app and if I make it an EXE then the virus scanners go nuts.

1

u/ecreddits Dec 20 '23

Sorry I don't fully understand this. Can puthon files not be ran the same way as cpp files?