Live data from Hacker News

I'm tired of fixing customers' AI generated code

medium.com

311–320 of 345 posts

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

#311
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…

What do you see as mistakes? I see some weirdness, but the spec is just not complete - there was no requirement for rewinding, multiple users, etc. in the request so it's not implemented. The only thing I'd call an actual mistake is using an empty list to mean both an empty file and an uninitialised value.

Well, there's also the fact that the entire thing could be replaced with...

    def cached_file_iterator(file_path):
        with open(file_path, 'r') as f:
            lines = [ line.strip() for line in f.readlines() ]
        yield from iter(lines)

    # Example usage:
    if __name__ == "__main__":
        file_path = 'example.txt'  # Replace with your file path
        
        iterator = cached_file_iterator(file_path)
        for line in iterator:
            print(line)

Which is functionally identical and FAR less code to maintain.

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

#312
> Often, though, the customer is envisioning a more complex application, and I just have to tell them, “Sorry, you’re going to have to hire a professional developer for this.”

Welcome to enterprise sales, where building custom solutions atop of your sprawling BaaS empire is exactly what you do.

Your customers have a need and you’re basically turning down an upsell opportunity that also buys you lock in to your platform.

Another way to look at it: are they all trying to build something similar or something with similar components? Maybe it’s time to expand the features of your product to reduce the amount of work they need to do.

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

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

Interestingly, a great application for GenAI is to copy and paste code and ask it, "Why is this not working?". It works even better if you give it the specific error you are getting (and it is a well understood system).

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

#315
post #211

Earlier quoted context omitted.

No need for quotes, the best AI integrations are the ones you see as just part of the tech stack like spell check and linters.

But that’s WoOoOrK. These stupid sobs want magic that does everything automatically.

Yes, labor costs aren't magically replaced by trained AI models, MBA protestations aside

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

#316
post #156

Earlier quoted context omitted.

sales engineer is quite a lucrative career. don't have to be really good at it, just enough to be useful.

Sales engineers have to be good enough to bluff their way through the layers of hyperbole/minor exaggeration/utter bullshit (delete as applicable) the sales team have spun. Whether their conscience gets involved before the deal closes, different question.

Not at my work. Around here sales engineers just say "this is a proof of concept, X will be different in the final version". Then, after they close the deal, they give us their half implemented feature they developed that none of us heard about before, and tell ys that we need to finish it and include it in the next release.

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

#318
post #315

Earlier quoted context omitted.

But that’s WoOoOrK. These stupid sobs want magic that does everything automatically.

Yes, labor costs aren't magically replaced by trained AI models, MBA protestations aside

I trust that you’re all done patting each other on the back now, yes?

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

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

I won't say all investors are entitled and overconfident, inspired by grifters, emboldened by survivorship bias, and motivated by greed. That would be rude

It’d also be pretty naive, speaking to your seemingly quite narrow experience with the outside world. So, thank goodness you didn’t say it.
Post reply on HN