Live data from Hacker News

I'm tired of fixing customers' AI generated code

medium.com

201–210 of 345 posts

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

#201
post #60
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.

I knew a guy that made a good living as a freelance web developer decades ago. He would pretty much just copy and paste code from tutorials or stack overflow and had no real idea how anything worked. Using code without understanding it is never a good idea, it doesn’t need to be from AI for that to be true.

This is a known issue from like the 2000s where there were so many bad PHP tutorials, a lot of SQL injection and XSS etc came from those.

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

#203

Earlier quoted context omitted.

Your second quote is the same as the first one. Did you copy the same one twice by accident?

I suspect the quote was pasted by mistake the first time.

Yeah, I moved the paragraphs around and pasted the quote in where it belonged, forgetting that it had been pasted at the top. Too late to edit, though.

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

#204

This seems like a support issue, not an AI issue. AI is how the code was written, but the issue would be the same if it was amateurs writing bad code. If all you want to do is support your API, a support article outlining the issues you see over and over would be something to point your customers to. Warrant your API against errors, but point out that anything more is billable work. If you're not interested, partner…

The difference is scale. I don't know how many times people need to say this, but LLM tools enable people to spam low quality code at a rate that is far faster than ever. There's been multiple stories and posts here on HN about issues with AI generated PRs for open source repos because of people using them to game numbers or clout. This is a similar problem where you have a bunch of people using your API and then eff…

Totally agree the difference is in the scaling properties.

On the other hand, I look around the room I am in and it is filled mostly with "low quality" Chinese made products. While you can't compare these products to expensive, expertly crafted, high end products, there is another scaling law at play when it comes to price. The low quality Chinese products are so cheap that I don't even consider the more expensive options. When the low quality desk lamp is close enough and 20x cheaper than the well made desk lamp, there is no decision point for me.

If it breaks, I will just buy another one.

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

#205
post #3

I'm always a little surprised at how many people out there want to develop software yet haven't put in the effort to gain even the most basic computer nerd programming chops. You see this all the time in the more newbie-friendly game engine communities. Maybe you don't want to pursue a career in software, but anyone can spend a week learning Python or JavaScript. I suspect/hope a lot of these people are just kids who…

Anyone who already programs for a couple of years can spend a week learning $lang. Learning programming for the first time takes a long while and a lot of effort. I'd say a couple of months if you're bright and motivated. Possibly a year or two if you're not.

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

#206
post #198

Someone mentioned "hallucination-based API design" on twitter (I cannot find it now). It's designing API by LLM hallucination. If there is a common hallucination API call, just add that API. This will make the API more "friendly" and resemble common similar APIs. Considering that LLM can hallucinate in different ways unpredictably, not sure whether it will work in practice.

Idk if "hallucination-based API design" specifically is The Way. There might be other ways of achieving the same goal. Also,LLM hallucination is changing/improving quite rapidly. That said, "Designed for LLM" is probably a very productive pursuit. Puts you in the right place to understand the problems of the day.

Adding a couple aliases for your endpoint might be a decent middle ground where you throw the hallucinating "AI" a bone, without contorting yourself at its will

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

#207

I've been saying for a while now that there's an absolute gold mine waiting for people who want to specialize in fixing AI generated applications. A lot of businesses are going to either think they can have generative AI create all of their apps with the help of a cousin of the wife of the accountant, or they unknowingly contract a 10x developer from Upwork or alike who uses generative AI to create everything. Once t…

Maybe for a very short amount of time.

I suspect this quickly will be like specializing in the repair of cheap, Chinese made desk lamps from Walmart.

If the cheap desk lamp breaks, you don't pay someone to fix it. You buy another one and often it will be a newer , better model. That is the value proposition.

Of course, the hand crafted, high end desk lamp will be better but if you just want some light, for many use cases, the cheap option will be good enough.

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

#208
post #185
post #141

Earlier quoted context omitted.

There's more than one mistake in the code given, and I tried just once. "Create Python code for iterating a file with a cache." class CachedFileIterator: def __init__(self, file_path): self.file_path = file_path self.cache = [] # List to store cashed lines self.current_index = 0 # Index for the current line to read def _read_lines_from_file(self): """Read lines from the file and cache them.""" with open(self.file_pat…

Garbage code is bad enough, but it's not like people have never had to walk juniors through mistakes before LLMs. But this is actually so much worse for that same reason - the type of developer who'd submit Copilot output (I can call it that, as it's definitely not code) for a PR is unable to respond to any comment beyond asking Copilot again and wasting everyone's time with 6 more rounds of reviews. I've literally h…

Bit of a tangent, though related. It looks like you accidentally stumbled into a version of test driven development ;)

With the big difference obviously being that typically the developer who writes the test also will write the code.

In some situations, this actually makes sense to do with junior developers as part of their training. Where a senior developer sits down with them and write out the tests together, then with the tests as a guide they are thrown into the waters to develop the functionality.

Of course, I suspect that in this case, you were not dealing with a junior. Rather the sort of person who looks at your tests, still is confused and asks for a "quick call" to talk about the tests.

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

#209
post #179

Earlier quoted context omitted.

I feel like we'll eventually all agree that it's a mistake to ask a generalist LLM for code. I've found ChatGPT to be fine at talking about code - like describing the difference between two APIs - but for generating nontrivial chunks of working code I think it's miles behind Copilot and similar. And I assume that's just because, y'know, ChatGPT can write sonnets and translate Korean to Swahili and whatnot. It's amazi…

Copilot uses ChatGPT.

It's powered by the same models, but it's not submitting questions to the Q&A prompt like people do when they ask ChatGPT to generate code for them.

(..I guess? I don't think any of it is public - one might naively suppose that by now it's actually using only a subset of ChatGPT's MoEs, or something, but who knows?)

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

#210

Someone mentioned "hallucination-based API design" on twitter (I cannot find it now). It's designing API by LLM hallucination. If there is a common hallucination API call, just add that API. This will make the API more "friendly" and resemble common similar APIs. Considering that LLM can hallucinate in different ways unpredictably, not sure whether it will work in practice.

Let's all give ourselves extra prosthetic fingers and mutilate our ears while we're at it.
Post reply on HN