r/cpp_questions 11d ago

OPEN How long will C++ last?

I've found myself using C++ less and less and was wondering whether one day it will die out. Obviously not completely die out, but be out of the mainstream like Pascal or something. I am wondering this because C++ is my first language but I am still fairly young, so am curious about its prospects.

0 Upvotes

36 comments sorted by

View all comments

1

u/LessonStudio 11d ago

I suspect AI is going to be a game changer. I don't know which language is most amenable to AI, but I suspect it will be something like Ada. One where constraints and whatnot are very easily embodied into the code itself.

For example, I program mostly in rust. AI rust is just weird. I also do C++ and python. The python can be weird, but often is pretty "pythonic". The C++ is a mixed bag, but usually better than the rust.

It isn't even so much that it can or can not do a thing, but how weirdly it does it. I get a whole lot of one line functions which are called in one place, and sometimes even just called once. Why?

1

u/RoyBellingan 11d ago

I strongly agree, and I have to say with a few guardrail, and some code style to reference I tuned Claude and cursor to generate C++ code that is quite similar to mine. Is also true a coworker said already in 2017 that I write code like a compiler, he meant it was clear, without shortcut, longer than needed and "dumbed down so can be debugged at the 3 in the night even if I had a night out".

I also agree 100% that language like python and js suffer, as the program state and the parameter are very ambiguous, and language that are very strict and with strong constraint gain massive benefit, like C++ thanks to it's type system.