Live data from Hacker News

I'm tired of fixing customers' AI generated code

medium.com

291–300 of 345 posts

Re: I'm tired of fixing customers' AI generated code

#291
post #186

Earlier quoted context omitted.

Users were calling their API.

programs call apis.

This is the silliest argument

I write API calls. I am a user of apis. If you want to be more pedantic than this I simply do not care and you should evaluate what benefit you are bringing to this conversation.

Re: I'm tired of fixing customers' AI generated code

#292

Earlier quoted context omitted.

would someone invent that and bother the author with that? I mean I suppose it's possible, but that seems like such a waste of time to me that I find that more unlikely. and while it's a typo, it's not fleinaem or something that's totally wrong, just a choice in breaking up the word filename. having written file handling code, the various permutations of filename and path and dirname get to be a bit much sometimes.

People are unhinged about AI so yes I think someone would invent a scenario like this for internet points

>people are unhinged about AI.

Well. We definitely agree on that.

Re: I'm tired of fixing customers' AI generated code

#293
post #134

Earlier quoted context omitted.

No, you can get variable names "mutated" on follow up requests. The thing is like sculpting with toothpaste.

I've been using copilot for as long as it has existed and what you are describing has not happened to me once. Literally on in the background 8 hours a day. Excuse me for not trusting the internet hivemind that hates everything that is hyped just a little bit.

My goto check of AI assistants is asking to write a function calculating the first N digits of Pi in Common Lisp. On at least two attempts when prompted to fix its code the model would change one of the variable names to T, which is a reserved symbol. So yeah pretty sure it does happen.

Re: I'm tired of fixing customers' AI generated code

#294
post #55

I had a related episode at work when my coworker asked me why his seemingly trivial 10 line piece of code was misbehaving inexplicably. It turned out he had two variables `file_name` and `filename` and used one in place of another. I asked him how he ended up with such code, he said he used copilot to create it. Using code from a generative AI without understanding what it does is never a good idea.

> Using code from a generative AI without understanding what it does is never a good idea.

Yes.

AI as a faster way to type: Great!

AI as a way to discover capabilities: OK.

Faster way to think and solve problems: Actively harmful.

Re: I'm tired of fixing customers' AI generated code

#295

Earlier quoted context omitted.

Claude gave me something similar, except these were both used, and somehow global variables, and it got confused about when to use which one. Asking it to refactor / fix it made it worse bc it'd get confused, and merge them into a single variable — the problem was they had slightly different uses, which broke everything I had to step through the code line by line to fix it. Using Claude's still faster for me, as it'd…

One thing I've found in doing a lot of coding with LLMs is that you're often better off updating the initial prompt and starting fresh rather than asking for fixes. Having mistakes in context seems to 'contaminate' the results and you keep getting more problems even when you're specifically asking for a fix. It does make some sense as LLMs are generally known to respond much better to positive examples than negative…

As someone who uses LLMs on my hobby projects to write code, I’ve found the opposite. I usually fix the code, then send it in saying it is a refactor to clarify things. It seems to work well enough. If it is rather complex, I will paste the broken code into another conversation and ask it to refactor/explain what is going on.

Re: I'm tired of fixing customers' AI generated code

#296
Every problem hides opportunities! I can see a future where documentation will be replaced by a plugin to an AI code service. Instead of providing users with documentation on how to use the package, devs will be training an LLM on how to assist the user in generating the interface code. An elaborate Chat GPT prompt for instance.

Re: I'm tired of fixing customers' AI generated code

#297
post #215
post #202

I can guarantee that all these users are following some "hustle university" course peddled by a Twitter influencer. Crypto and AI are the two favorite words of all these get rich quick scams.

You can be a Google dev, and make half a million a year! For only $29.95, we'll show you how to empower yourself with the wonders of AI!

Typically the decimal separator is two steps to the right here.

The other day my friend showed me a curious screenshot where an, ahem, dev influencer showed all the courses he's done.

Problem is, just one of those six courses amounted to two average net salaries in the region and they were fairly basic.

Either the guy in question had a year's worth of runway (then why even bother getting into IT?), got into debt or... didn't actually pay for any of this and it was not disclosed.

I do my best to dissuade people from spending their hard earned money on such things, but a significant chunk unfortunately does not listen.

Re: I'm tired of fixing customers' AI generated code

#298

Earlier quoted context omitted.

One thing I've found in doing a lot of coding with LLMs is that you're often better off updating the initial prompt and starting fresh rather than asking for fixes. Having mistakes in context seems to 'contaminate' the results and you keep getting more problems even when you're specifically asking for a fix. It does make some sense as LLMs are generally known to respond much better to positive examples than negative…

As someone who uses LLMs on my hobby projects to write code, I’ve found the opposite. I usually fix the code, then send it in saying it is a refactor to clarify things. It seems to work well enough. If it is rather complex, I will paste the broken code into another conversation and ask it to refactor/explain what is going on.

Fixing the mistake yourself and then sending the code back is a positive example, since you're demonstrating the correct way rather than asking for a fix.

But in my experience, if you continue iterating from that point, there's still a risk that parts of the original broken code can leak back into the output again later on since the broken code is still in context.

Ymmv of course and it definitely depends a lot on the complexity of what you're doing.

Re: I'm tired of fixing customers' AI generated code

#299
post #293

Earlier quoted context omitted.

I've been using copilot for as long as it has existed and what you are describing has not happened to me once. Literally on in the background 8 hours a day. Excuse me for not trusting the internet hivemind that hates everything that is hyped just a little bit.

My goto check of AI assistants is asking to write a function calculating the first N digits of Pi in Common Lisp. On at least two attempts when prompted to fix its code the model would change one of the variable names to T, which is a reserved symbol. So yeah pretty sure it does happen.

[deleted]

Re: I'm tired of fixing customers' AI generated code

#300
I often think about code when I'm driving. I've thought about a way to brainstorm code ideas out loud and have the llm generate a code file with my idea. I'm talking about a fairly granular level, where I'm specifying individual if blocks and the like. Then when I have my hands available I can correct the code and run my idea
Post reply on HN