AI-generated code contains more bugs and errors than human output

https://reddthat.com/post/56712364

AI-generated code contains more bugs and errors than human output - Reddthat

Lemmy

I’ve been coding for a while. I did an honest eager attempt at making a real functioning thing with all code written by AI. A breakout clone using SDL2 with music.

The game should look good, play good, have cool effects, and be balanced. It should have an attractor screen, scoring, a win state and a lose state.

I also required the code to be maintainable. Meaning I should be able to look at every single line and understand it enough to defend its existence.

I did make it work. And honestly Claude did better than expected. The game ran well and was fun.

But: The process was shit.

I spent 2 days and several hundred dollars to babysit the AI, to get something I could have done in 1 day including learning SDL2.

Everything that turned out well, turned out well because I brought years of skill to the table, and could see when Claude was coding itself into a corner and tell it to break up code in modules, collate globals, remove duplication, pull out abstractions, etc. I had to detect all that and instruct on how to fix it. Until I did it was adding and re-adding bugs because it had made so much shittily structured code it was confusing itself.

TLDR; LLM can write maintainable code if given full constant attention by a skilled coder, at 40% of the coder’s speed.

It’s basically just for if you’re lazy and don’t want to write a bunch of boilerplate or hit your keyboard a bunch of times to move the cursor(s) around

It is great for boilerplate code. It can also explain code for you, or help with an unfamiliar library. It’s even helped me be productive when my brain wasn’t ready to really engage with the code.

But here’s the real danger: because I’ve got AI to do it for me, my brain doesn’t have to engage fully with the code anymore. I don’t really get into the flow where code just flows out of your hands like I used to. It’s becoming a barrier between me and the real magic of coding. And that sucks, because that’s what I love about this work. Instead, I’m becoming the AI’s manager. I never asked for that.

I generally agree with what you’ve said for sure. I think I’ve honestly started to use it for helping me to go pinpoint where to go look for issues in the spaghetti code of new code bases. I’ve also mostly tried to avoid using it in my personal coding time but I feel like it’s gotten harder and harder to get legitimately good search results nowadays which I realize is also because of ai. Given the choice I’d happily just erase it from existence I think. Spending hours sifting through reddit and stack overflow was way more fulfilling + I feel like people used to be slightly less prickly about answering stuff because that was how you had to get answers. It seems like lemmy could replace that space at least, I’ve genuinely gotten helpful comments and I’ve always felt downvotes on here have been productive versus what Reddit is now.
I’ve found the same thing. I’ve turned off the auto suggestions while tying because by the time I’m typing i already know what I’m going I’m to type and having mostly incorrect suggestions popping up every 2 seconds was distracting and counterproductive.