logoalt Hacker News

socalgal2 • today at 2:19 AM • 5 replies • view on HN

I'm sure I'm not the only one but I feel like C++ is over/done. I work in a C++ code base and have been doing C++ for > 20 years and to me at least, the writing is on the wall.

1. C++ is unsafe. Bjarne keeps giving talks that effectively say "use it perfectly and don't make any mistakes and it's safe". That's not useful anymore. In a world where LLMs can find every mistake to exploit it, all the C++ projects are struggling to keep up and keeping them in C++ is basically guaranteeing there will be more exploits in the future. Yes, not every bug gets solved by switching to a safer language but reducing the attack surface in the new reality is no longer something that can be put off.

2. LLMs can re-write. The previous arguments used to be "there are C++ legacy code bases so C++ will never die". That was a valid argument before an LLM would just rewrite it all. I get people will say they aren't perfect, neither are humans though. Further they get better all the time, and we see their progress. People pointing an LLM at some project and it magically making it work on some other platform etc... It's clear it's happening.


Replies

j4k0bfr • today at 6:02 AM

I'd like to live in a world where an LLM can exhaustively verify all C++, and where porting C++ codebases is safe and easy. However I'm not fully confident we're there yet.

Plus, there are a lot of pros to C++ which aren't so easily waved aside. The breadth and duration of support makes it almost impossible to kill quickly, imo. If a magical LLM bullet shot C++ dead tomorrow, many established orgs and projects would keep it rolling. It also sits in a funny spot where you can get pretty good performance from not-great code. And it is incredibly fun to write! Reading it is... another matter ;).

Edit: I'm sure dumping piles of money into abliterated models can get you quite far. ROI and correctness are the parts I'm still sus about, however I hope to be proved wrong.

rerdavies • today at 4:58 AM

On the other hand, LLMs can (and do) also find every mistake and fix it.

I'm not ashamed to admit that I occasionally ask my LLM to find and fix all the bugs in a file. And not ashamed to admit that it often does. Most usually algorithmic problems, not memory problems, fwiw, because I use modern C++.

nmfisher • today at 4:11 AM

I recoil when I look at the roadmap for C++2x (most of it, anyway), it's a bloated monster and I suspect the language is on its last legs.

It will probably take a lot longer to die than I expect, though, too many legacy third party libraries are written in C++ and most people don't really like the syntax for the logical alternative (Rust).

➕ show 1 reply
eluru • today at 3:45 AM

As obvious as they sound i havent tought about those points before, they do make sense

tsss • today at 10:10 AM

I was at a Bjarne Stroustrup talk 2 years ago and it was pretty embarrassing. He was dodging Rust questions all day long, giving nothing but non-answers that would make any politician proud. But perhaps "dodging" is the wrong word here; more like "being run over". He has no vision for the future of C++ besides "it's its own thing" and "everyone is already using it". His best idea is to publish a compiler preset that disables the most dangerous features.