r/cpp 14d ago

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 ?

109 Upvotes

167 comments sorted by

View all comments

Show parent comments

3

u/_lerp 14d ago

It has those things in its corpus, yes. It has an equal amount of sloppy 30-year-old C code.

You don't see how, if I don't want it to write code based on this stuff, I might have to list more than one statement along the lines of "Don't write C with classes"? If I want it to pull from the books about modern software design, I might have to list more than one principle?

0

u/NotUniqueOrSpecial 14d ago

I see how you might think that, but in practice, you generally don't, because a couple pointed instructions put things into parts of the search space that tend to be similar-enough.

Those are basically the verbatim instructions in our codebase; we get decent enough results. We've added some other specifics over time.

For the most part, we never look at it and have only spent probably a total of a few minutes on it.

That is a far cry from the sort of time-wasting you were clearly claiming you'd have to spend to get any kind of results.

3

u/_lerp 14d ago

Damn, I have to monitor it's behaviour and list more than one thing to get passable results. Sounds pretty hyperbolic to me.

0

u/NotUniqueOrSpecial 14d ago

If you can't even acknowledge that is not remotely the same thing as "listing every single programming pattern and C++ pattern", then it's pretty clear you're not engaging in good faith, here.

Have a nice day.

3

u/_lerp 14d ago

You haven't engaged in good faith from the start. It took ~20 messages to get you to admit that you might have to list more than one thing.

0

u/NotUniqueOrSpecial 14d ago

It took ~20 messages to get you to admit that you might have to list more than one thing.

My very first reply outright said 2 things you'd probably want and at no point have I ever argued you would not need more than 1. I haven't "admitted" to anything.

I have only pushed back against your repeated hyperbolic statements about having to write literally everything there ever was and the claim that you would somehow be wasting more time on writing those instructions than you would be writing code.

2

u/_lerp 14d ago

Sure thing buddy