logoalt Hacker News

yodsanklai • today at 1:06 AM • 2 replies • view on HN

You're very diplomatic (yet downvoted), C++ is an abomination of a language. It just puts too much accidental cognitive load on developers. I understand that

- it shines for some tasks where Rust isn't capable enough

- it's impossible to get rid of because of all the code so we may as well modernize it

- there's an active community of people who built a career of being C++ experts and have no interest to see the language disappears.

Even in the LLM era, I find it's difficult to code in C++. The language has so many corner cases that LLMs make mistakes. My experience 6 months ago was that the code written by my agent had tons of complex linter warning (exceptions, lambda leaking references, futures whatever... that I just can't avoid because the codebase mixes all of this). Whenever possible, it's probably time to either modernize it or port it to Rust, component by component, until the C++ part is small or inexistant.


Replies

stackghost • today at 7:26 AM

It’s been my experience that pair programming specifically in C++ with an LLM rather than having it write the code is a great way to stay sharp.

rerdavies • today at 4:42 AM

Maye you need a better AI. Just sayin'. My AI (Claude) doesn't make mistakes. Ok. It doesn't always think strategically, or factor well. But it certainly doesn't struggle with language mechanics.

Modern best practice for C++ is to crank the warnings to maximum, and to treat warnings as errors. You absolutely should treat linter-like warnings as an error, because they invariably are. So you know.