Live data from Hacker News

I'm tired of fixing customers' AI generated code

medium.com

171–180 of 345 posts

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

#171
post #68

> Helping a customer solve challenges is often super rewarding, but only when I can remove roadblocks for customers who can do most of the work themselves. One thing I loved about doing technical enterprise sales is that I’d meet people doing something I knew little or nothing about and who didn’t really understand what we offered but had a problem they could explain and our offering could help with. They’d have deep…

This is honestly something I'm grateful for a lot of the time. I'm presently running a tech start-up in a highly technical domain (housebuilding, in a word) which also happens to be pretty hostile to businesses. People look at a planning application like "Why are there hundreds of documents here?" and it's because yeah, it is hard - there are huge numbers of variables to take into account, and the real "art" of urban design is solving for all of them at once. Then you send it to planning and basically no-one is happy, why haven't you done this and what are you going to do about that. You have to be pretty creative to survive.

Before that, I worked in a digital print organisation with a factory site. This factory did huge volumes on a daily basis. It was full of machines. They had built up a tech base over years, decades, and it was hyper-optimised - woe betide any dev who walked into the factory thinking they could see an inefficiency that could be refactored out. It happened multiple times - quite a few devs, myself included, learned this lesson the hard way - on rare occasion thousands of lines of code had to be thrown out because the devs hadn't run it past the factory first.

It's an experience I'd recommend to any dev - build software for people who are not just "users" of technology but builders themselves. It's not as "sexy" as building consumer-facing tech, but it is so much more rewarding.

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

#172
I‘m tired of fixing my colleagues‘ AI generated code. They churn out a lot of code in a short amount of time, but then we loose the saved time again because during pull request review they often cannot explain what this code is actually doing. Maybe I should use an AI for code review, too?

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

#173

[flagged]

Language models aren’t AI no matter how hard you squint. When we get actual AI (not counting on anytime soon) it will be more than the annoyed developer that loses their job

A better term is 'machine'. The "AI revolution" has been causing friction for several centuries already, most famously with Luddites' fight against AI looms.

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

#174
> My API is just a few well documented endpoints. If you can figure out how to send a POST request using any programming language, you should have no problem using it. But that seems to be too high a bar for the new generation of prompt-engineer coders.

Nice. The time has come that we need to design the API with the LLM in mind. Or, to rephrase that, test your API that it is working with the popular LLM tools regularly.

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

#175
post #160

Earlier quoted context omitted.

I doubt LLM hallucinations will produce good secure code. In my opinion, using code from LLMs, which might see your program come to life a bit quicker, will only enhance the time needed for debugging and testing, as there might be bugs and problems in there ranging from trivial things (unused variables) to very subtle and hard to find logic issues which require a deeper knowledge of the libraries and frameworks cobbl…

The description here isn't about using LLM hallucinations as code. It's using them as example API users and seeing what they get stuck on. Let's say you've got some rest API. Are they trying to send PATCH requests but you only support POST? Do they keep trying to add pagination or look for a cursor? Do they expect /things to return everything and /things/id to return a single one but you have /things and /thing/1 ? N…

Ah, sorry, totally didn't get that it was using them as users of the API.

I would recommend API fuzzers here, which cycle through all available possibilities, and generate 'garbage' inputs as well as structured inputs regarding the specifications the APIs implement (http, and the underlying structures provided to the api endpoints).

an LLM would likely not perform an exhaustive test.

There are several projects freely available to run such fuzz tests. Eventhough that does eat up considerable resources, and 'resetting' state during such tests can be problematic at best, the same would apply for LLM based testing. (database gets screwed in some way, and the next request is not on a 'clean' state.)

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

#176
post #172

I‘m tired of fixing my colleagues‘ AI generated code. They churn out a lot of code in a short amount of time, but then we loose the saved time again because during pull request review they often cannot explain what this code is actually doing. Maybe I should use an AI for code review, too?

Why are these people employed? Isn’t that a bit like a fake employee who outsources his work behind your back? You can’t work with the guy because he literally doesn’t even know or understand the code he’s pushing to the repo

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

#177

> Often this takes the form of trying to access an endpoint that does not exist, or read a property off the API response that does not exist. After probing a bit more, my suspicions are usually confirmed — ChatGPT hallucinated that endpoint or property In some cases, you might be able to use this to your advantage to improve the product. When working with third-party APIs, I've often run into situations where my code…

another consideration: if a popular AI model hallucinates an endpoint for your API for one customer, chances are another customer will run into the same situation

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

#178
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.

We hired a new guy at work. In one of his first tasks he had chosen to write some bash, and it was pure nonsense. I mean it contained things like: if [ -z "${Var}+x" ] Where I can see what the author was trying to do, but the code is just wrong. I dont mind people not knowing stuff, especially when it's essentially Bash trivia. But what broke my heart was when I pointed out the problem, linked to the documentation, b…

And of a salary...

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

#179
post #145

Earlier quoted context omitted.

> It's possible that ChatGPT is "thinking" the same thing here; that most APIs have an X endpoint to make a task easier, so surely yours does too? While this is possible, I would caution with an anecdote from my ongoing side project of "can I use it to make browser games?", in which 3.5 would create a reasonable Vector2D class and then get confused and try to call .mul() and .sub() instead of the .multiply() and .sub…

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.

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

#180

Yeah so every tech revolution does this right. ATMs were meant to kill banking jobs but ah theres more jobs in banking than ever. The Cloud was meant to automate away tech people, but all it did was create new tech jobs. A lot of which is cleaning up after idiots who think they can outsource everything to the cloud and get burned. LLMs are no different. The "Ideas Man" can now get from 0 to 30% without approaching a…

Sadly everyone thinks they are The "Ideas Man".
Post reply on HN