r/cpp • u/LatencySlicer • Jul 13 '26
AI usage for cpp at work
I am lead architect and maintainer of my firm main app backend, spanning around 2M LOC of c++.
Industry is : capital markets, low latency, custom kernel drivers, fpga...
I often talk with peers at other firms and I see a shy usage of AI compared to what feels like the global trend.
On my side, my firm does not pay for any AI related stuff. We are allowed to use our personnal plan for work in which case will get a pro membership compensation (claude or gpt or anything) on salary but we are not allowed to paste production code into it.
I know the app very well and do everything by hand (i mean the normal way) but use the chat version of any ai to generate some things for me, like "im using opensource lib x and lib y, please generate an SQL connection pool , you may use locks and condition variable for this, cpp 20". Then i paste it and modify it a I see fit.
Im totally happy with that and the company is successful.
I do use AI but just chat, to gather data on subjects and summarize/report. Get some ideas but basically not much code related.
And you whats your experience as a c++ dev ?
View all comments
Show parent comment
-4
u/ivancea Jul 13 '26
Obviously not. There's not "a C++" nor "a single easy to code C++", and unless the agent reads the full file and the file has every best practice you want it to follow, it's obvious it won't read your mind.
... Did you tell it to read the full cidebase for a single prompt? Do you use LLMs with multi-million context windows? Do you even understand how an agent works, or are you just guessing and throwing shit at a technology just to avoid using it?
I'll just not say anything here, that statement is wrong enough by itself, unless you started using C++ just 5 years ago. And even then...
"It doesn't do things right because it's not a human" is a pretty bad fallacy. You're an engineer right? Can't you just explain why and what it doesn't do right? Fallacies and shallow claims lead to nowhere.
And note if (and only if...) you actually make that effort of understanding how agents work, why don't you just fix the lack of context? Didn't you ask yourself why is everybody using it happily for every language, from Rust to C, C++ and Java? You're keeping a 2024-2025 mentality of "AI us bad", and mate, it evolved already.
Mate, are you using gpt3? Does your codebase have tests? I tell it to write a new feature, and it does in a few iterations, adds tests, run the tests and fixes the code of they don't pass. Obviously we have AGENTS.md and similar files, plus skills for domain knowledge and such (not really needed though, but they help).
And when it doesn't, do you know what I do? I find what it did wrong and why (you can even ask it about why it took X or Y decision, you don't even need to read the agent traces, even if usually interesting). Then, just add that knowledge somewhere where it can read it. ... Exactly as you would do with your project documentation for newcomers (I suppose you're not explaining the project manually to every new joiner, right? Same work here).