Live data from Hacker News

I'm tired of fixing customers' AI generated code

medium.com

331–340 of 345 posts

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

#331
post #148
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. True, but the anecdote doesn't prove the point. It's easy to miss that kind of difference even if you wrote the code yourself.

> It's easy to miss that kind of difference even if you wrote the code yourself.

The developer in the story had no idea what the code did, hence they would not have written it themselves, making it impossible for them to “miss” anything.

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

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

Please also consider this when a localization contractor advertises lower costs by having human editors go over machine translations, then.

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

#334
post #129
post #60

Earlier quoted context omitted.

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.

Or maybe you’re just exaggerating. I’ve done my fair share of copy pasting and it never worked to just do it without understanding what’s going on. I think the problem with “AI” code is that many people have almost a religions belief. There’re weirdos on internet who say that AGI is couple years away. And by extension current AI models are seen as something incapable of making a mistake when writing code.

I've seen it too. You can get away with a lot of inefficiencies and still technically get the job done.

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

#335
post #211

Earlier quoted context omitted.

And any decent IDE will highlight a variable that is declared but unused. We already have "artificial intelligence" in the form of IDEs, linters, compilers, etc. but some people apparently think we should just throw it all away now that we have LLMs.

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.

Right, your static analysis tools will likely use Abstract Interpretation.

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

#336

Earlier quoted context omitted.

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…

https://stackoverflow.com/a/13864829 It is not nonsense. You use that expression if you want to check if a variable exists or not (as opposed to being set to an empty string) which is an extremely common problem.

That what I meant by "I can see what they were trying to do". It's would have been correct if the "+x" was inside the braces, even in context. He did in fact want to check if the variable was unset and error out, and that's what hurts so much.

There was a real and correct analysis that, hey, I want to make sure the variable is set here. Only to then drop it because you get told the syntax is wrong. The response I'm looking for when I say "This syntax won't do what you're looking to do" would be something like "what am I trying to do? and why wont this do it?" not "well it's just some AI code, I'll just remove it".

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

#338
post #119

Earlier quoted context omitted.

One of my favorite intern stories was a kid who was a compsci senior, very good university, and who was assigned to write some Python code for my team. He had the very immature "Python is a baby's language" attitude. He wasn't working on my stuff so I don't really keep track of what he's doing, but a few weeks later I look at what he has written. Almost all of his Python functions have one parameter with an asterisk,…

This sort of thing is a weird relic of CS programs doing double duty as "professional school for software development" and "undergrad prep for an academic math career." You just don't know how much they actually learned about programming as a discipline in its own right and it very well could be functionally zero. I've seen recent CS grads who didn't know how to use git, didn't know how to split code across multiple…

IMO it could be closer to a doctor/nurse dichotomy. Doctors learn medicine. From top to bottom, then insanely deep into their specialty, if they aren't a generalist. Then they spend the rest of their lives keeping up with new medical research and often doing much of it themselves, teaching others, etc., along with practicing medicine. To do that last part, the act of which justifies all of the research, they do residencies. Nurses have their own training pipeline that often centers much more patient management and practical application of medical research. It's an easier training pipeline and they are paid much less, but the fact is that most people don't have what it takes to be a doctor, and the world doesn't need that many of them, it needs more practitioners.

Likewise, I think that any person who is going into the software development industry should either do it as one who gets a deep compsci education along with mandatory training in a modern practitioner skillset, or one who just learns how to practice software dev with just enough theory to handle basic problems. One could also go pure compsci, but the academia+practitioner path I mentioned earlier should have a separate title so that you can trust that the person with this credential has some baseline utility right out the gate.

Right now, "computer science" encompasses all of this, which is a huge problem for employers.

At the very least, it would be nice if we settled on some universal definitions for various job roles, including "computer scientist", "software engineer", "software developer", etc. Right now, all of these are floating signifiers!

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

#339

Earlier quoted context omitted.

At least for me stupid bugs like this turn out to be some of the most time wasting to debug, no AI involved. Like accidentally have something quoted somewhere, or add an 's' to a variable by accident and I may not even correctly process what the error message is reporting at first. Always feel a bit silly after.

These kinds of problems are often avoidable by linters or asking ChatGPT what is wrong, though I was just tearing my hair wondering why TSC_COMPILE_ERROR wasn't skipping TypeScript because I spelled it TSX_COMPILE_ERROR in my environment variable.

Subtle typos easily misread are
Post reply on HN