r/C_Programming • u/hashcode777 • Jul 20 '26
Question Systems devs: Is AI code generation actually saving you time, or just creating auditing hell?
Hey everyone,
With Linus Torvalds recently embracing and defending AI tools in Linux kernel dev, I’ve been trying to force myself to use LLMs more in my daily low-level workflow. On one hand, if the Linux kernel ecosystem is adopting it to find bugs and speed things up, it feels like something we should all be leveraging.
But on the other hand, on a practical, day-to-day level? It feels like a massive trap for actual systems engineering.
Every time I let an LLM spit out a driver, a custom memory allocator, or complex socket-handling logic, I end up spending the next hour reading 150 lines of statistically plausible C/Rust code just trying to figure out if it’s going to cause a catastrophic race condition or a silent memory leak under load.
The thing is, if I just write the code myself, I have absolute control over the execution path. Because I build the mental model layer by layer while typing it out, my own code is fundamentally way more understandable to me than anything an LLM drops in my lap. I actually know why it works.
Instead, with AI, I feel like I'm trading the active problem-solving of writing code for the mind-numbing task of auditing code written by something that has zero actual intent.
How are you low-level devs actually integrating these tools without losing your sanity, your control, or your deep understanding of the codebase? Or are you just ignoring the hype cycle despite the kernel maintainers getting on board?
95
u/blargh4 Jul 20 '26
don’t hand off your brain to it and it’s a perfectly useful tool.
15
u/PseudoFrequency Jul 20 '26
It speeds up my work but I have to force it to do things exactly as I want it. I can't get it to generate anything moderately complicated without it being completely wrong and it typically won't even compile if I try to get it to generate an entire module. I basically use it for autocomplete on steroids. We have very rigid code standards and reviews at my work.
62
u/mlugo02 Jul 20 '26
It’s turning into auditing hell. So much code is being pushed that it’s taking around a month to get a single PR reviewed
25
u/soundman32 Jul 20 '26
"Every time I let an LLM spit out a driver' - vibe coding a whole project is never a good idea. You wouldnt let a junior spit out a whole driver either, would you?
9
u/ComplexPeace43 Jul 20 '26
I write code and ask the LLM to review. Often it suggests me better way of writing which helps me learn new things. Yeah the old way was reading code but I think our attention span has drastically reduced.
18
u/FitMatch7966 Jul 20 '26
Your questions conflates AI tools used for evaluation and security, with AI generation which is writing code.
Tools that can review code, make suggestions, find security holes, etc and critical. If you don’t used them, your attackers will.
Code generation…good luck. Eventually somebody needs to look at it
1
u/tastygames_official Jul 26 '26
Linus kinda didn't actually embrace it... not fully. He said "we don't write machine code anyway - the compiler does" and "AI's fine for doing stupid small stuff that won't go into production, but not for anything important that should be around for a long time". So basically only used for prototyping - if you want. He admitted they use ML (not generative AI) to generate lists of potential problems to investigate, but not that generated code is "OK". And generated code is not deterministic like a compiler is - so not the same thing. I think he was being facetious about that aspect. But yeah - ML as a statistic tool is cool!
I use LLMs as search engines. That's about it. They try to write some code for me sometimes, but I know it's not going to work right out of the box, and I specifically don't give much context as I don't want it to know about my code or ideas - I usually just want some info on optimizing algorithms or something. Anyway, it usually produces some decent enough pseudo-code or might know about some typical conventions, but I'm gonna write the stuff myself since I'd still have to re-write it anyways. Saves time.
I will mention I only use the free shit. Not gonna give the techbroligarchs a dime for shit they stole from humanity.
3
u/UnfairDictionary Jul 20 '26
If I ever generate code with AI, it is for the purpose of basic code that I don't want to do manually, but I always read through it and fix slop problems. It is my responsibility to check the code I am contributing, not my co-workers' or project peers' or other contributors'. It is unacceptable to create unnecessry work for others just because you happen to be lazy. AI makes you worse if you are making it solve problems that you do not unserstand. AI makes you better, when you use it to do stuff you already fully understand and what you know saves your time. You still need to check it and fix it. Maybe even refactor it.
However, I am mostly pretty much anti AI because of people who do not use it right and push slop to others. Also because of the environmental effect and people stupidifying effect. In my experience, it has been less useful than harmful in total because it is used wrong.
3
u/arkt8 Jul 20 '26
It is a lie to put on the Linus account the AI use incentives.
AI is a probabilistic tool, not a deterministic one. Its usage as a consultant or reviewer is a valid usage, not as a developer.
When Linus says AI is a tool, yes, it is a nice tool to find some bad patterns or places prone to bugs and also strange undocumented spots.
Now to generate codes and submit them has a BIG NO. If you need an argument, just one, it that because it is not deterministic.
This is the perfect characterization as a tool. It cant ans shouldn take decisions on what or which code should be written, but hint only like errors or warnings of a compiler.
2
u/Sibexico Jul 20 '26
AI helps me good to proofreading readme files for typos and grammars. But I prefer to write the code by myself instead of audit low quality AI slop.
0
u/reini_urban Jul 20 '26 edited Jul 20 '26
It's improving my sanity and productivity. I don't have to write so much code by myself anymore, just have to check and harness it. Much more tests, more features, less bugs
1
u/logic_circuit Jul 20 '26
After project outgrow one man party, to many source code restores. After my first restore to save time even dumbshit AI do not atempt to fix it; it asks me to restore claiming that we will save time and code integrity. Wtf? I am supposed to say that.
1
u/Conscious_Buddy1338 Jul 22 '26
A month ago Claude write me the C code, where it try to find the size of array in C via sizeof. After it, for me everything is clear....
1
u/mykesx Jul 22 '26
Not only is the auditing of the generated output of the LLM a hassle, it's not really a good learning experience. The few times I tried it, the code was full of errors and realizing each one was more time consuming than just writing the code myself. I already understand what I write and it's almost always correct enough that a little bit of debugging makes it work.
Plus it is plagiarism by definition, lifting someone else's work and giving no credit for that work.
1
u/cdtrmnbaell Jul 23 '26
*uck ai .
1
u/catladywitch Jul 23 '26
write it yourself and ask ai for feedback. that's the move imo
1
u/val_anto Jul 20 '26
I find it very useful for starting the boilerplate for new projects or features, and it does speed up the process there. More than that is a story with many failures as well as successes
1
u/DaveAstator2020 Jul 20 '26
It is useful in regard that now i only need to read code, and write prompts. So that cognitive load for writing code is gone. But when it comes to math and architecture - its still on you.
1
u/irqlnotdispatchlevel Jul 20 '26
It's just another tool in the box.
It's very good at exploration so if I'm working on a part of the code base I'm not familiar with, it saves me time. This doesn't completely replace the old and tried "just ask another engineer", but can be a huge time saver.
It's also useful at quickly writing a PoC just to get the feeling of an idea. I sometimes end up scraping that, other times I make small changes myself. Sometimes you have to iterate on it, ask for improvements, justifications, etc. This can feel like wasting time in some cases, but you can end up with genuinely impressive results. Not sure if it's a net time saver.
Very powerful for issue triaging, and debugging in general, but I suspect that this is highly dependent on pre-existing tooling and infrastructure. We have it setup so that every bug report contains an automatically generated summary with hypothesis and supporting evidence for each one. We already had strong automation here before LLMs.
Very powerful in writing tests, but this is again dependent on pre-existing infrastructure and good pre-existing tests it can use as a model.
Data visualization. Not a core competency of the role, but often times throughout my career I had to present data to peers or decision makers. The most impactful way of doing that is with charts. It is a huge time saver here. Often times I already know what I want and it is just a matter of execution, and I'm happy to outsource that work to an LLM while I take care of other things. Pretty nice at exploring the data by itself, but you have to be very careful and not allow it to draw conclusions, or really really check those, especially if you didn't give it the full context.
I wouldn't go back to working without an LLM asistent, I wouldn't trust one to completely replace another engineer.
-4
u/kun1z Jul 20 '26 edited Jul 20 '26
EDIT - READ ME
I have a 6+ year posting history in /r/C_Programming with no mention of any AI at all. I also have 2694 karma in this subreddit. No, I am not an Ad for Cursor AI, nor a bot, nor paid by them, nor invested in them. I have 0 investments in any company, not a single one, AI or otherwise. My post is legit, go through my comment history yourself. I have no friends/family invested in AI that I know of and if they are they've never spoken to me about it.
We starting using Cursor AI mid-May in Embedded development and at first I was telling my boss it would never solve difficult and obscure problems and a month later it was solving everything and anything we could throw at it. I would have bet my life some of things it solved wouldn't be solvable by an AI for at least another 5-10 years but nope, solved it fast.
For example: It can read schematics, obtain datasheets of the IC's, read them, find out the memory address's and masking for it's hardware registers, create a driver for all of them, glue them all together with code, then create bash scripts (or python scripts) as 1-time installation/setup guides, and it was almost always completely bug free. If it did have bugs it would fix them fast. But that's not all; we needed to decode 2 very old proprietary buses (used in the 70's and 80's) where all we could do is dump the raw hex into files and perform experiments on what actions would cause what bus traffic. Well that was no problem for the AI which would do all of that work for us, monitor the bus traffic, and it eventually (over-night) solved every single bus packet and format and also coded up an interface API to log specific info we needed.
It did all of that for I think $199 USD per month. It would have taken us months to create that same code base at a cost of tens of thousands of dollars.
I can't speak of any other AI but Cursor AI is insanely amazing at whole-project development. Elon just bought it last month and they are planning on it's next huge new version coming out I think people are saying Q3 this year.
AI is a new tool no different than compilers became a new tool for assemblers to save lots of time writing code. My job is slowly transforming from C/Embedded programmer to someone who just manages the project and now I brainstorm new ideas the customer might want. Aside from here and there I barely write any code anymore. I stopped looking at it too, no point.
-4
u/harexe Jul 20 '26
I use it for error finding, sometimes i tend to switch * and & and don't notice it quickly but the ai does.