News for hackers. Stuff that matters.
Re:A ChatGPT mistake cost us $10k by userbinator on Sunday June 09, 2024 @05:47PM (#40627898)
It read like no one really knew what they were doing. "We just let it generate the code and everything seemed to work" is certainly not a good way to market your company.
Re:A ChatGPT mistake cost us $10k by mort96 on Sunday June 09, 2024 @07:47PM (#40628582)
Eh I imagine they looked over the code as well, doing code review -- and at first glance, the code looks reasonable. I certainly wasn't able to catch the bug even though I tried to find it (and I was given a tiny collection of lines and the knowledge that there's a bug there!).

If anything, I think this says something about how dangerous ChatGPT and similar tools are: reading code is harder than writing code, and when you use ChatGPT, your role stops being that of a programmer and becomes that of a code reviewer. Worse, LLMs are excellent at producing plausible output (I mean that's literally all they do), which means the bugs will look like plausibly correct code as well.

I don't think this is indicative of people who don't know what they're doing. I think this is indicative of people using "AI" tools to help with programming at all.

Re:A ChatGPT mistake cost us $10k by throw46365 on Sunday June 09, 2024 @08:23PM (#40628769)
> I don't think this is indicative of people who don't know what they're doing. I think this is indicative of people using "AI" tools to help with programming at all.

I think using AI tools to write production code is probably indicative of people who don't really know what they are doing.

The best way not to have subtle bugs is to think deeply about your code, not subcontract it out -- whether that is to people far away who both cannot afford to think as deeply about your code and aren't as invested in it, or to an AI that is often right and doesn't know the difference between correct and incorrect.

It's just a profound abrogation of good development principles to behave this way. And where is the benefit in doing this repeatedly? You're just going to end up with a codebase nobody really owns on a cognitive level.

At least when you look at a StackOverflow answer you see the discussion around it from other real people offering critiques!

ETA in advance: and yes, I understand all the comparison points about using third party libraries, and all the left-pad stuff (don't get me started on NPM). But the point stands: the best way not to have bugs is to own your code. To my mind, anyone who is using ChatGPT in this way -- to write whole pieces of business logic, not just to get inspiration -- is failing at their one job. If it's to be yours, it has to come from the brain of someone who is yours too. This is an embarrassing and damaging admission and there is no way around it.

ETA (2): code review, as a practice, only works when you and the people who wrote the code have a shared understanding of the context and the goal of the code and are roughly equally invested in getting code through review. Because all the niche cases are illuminated by those discussions and avoided in advance. The less time you've spent on this preamble, the less effective the code review will be. It's a matter of trust and culture as much as it's a matter of comparing requirements with finished code.

Re:A ChatGPT mistake cost us $10k by abraae on Sunday June 09, 2024 @08:35PM (#40628855)
> And where is the benefit in doing this repeatedly? You're just going to end up with a codebase nobody really owns on a cognitive level.

You could say the same about the output of a compiler. No one owns that at a cognitive level. They own it at a higher level - the source code.

Same thing here. You own the output of the AI at a cognitive level, because you own the prompts that created it.

Re:A ChatGPT mistake cost us $10k by l33t7332273 on Sunday June 09, 2024 @09:53PM (#40629383)
>No one owns that at a cognitive level

Notwithstanding the fact that compilers did not fall out of the sky and very much have people that own them at the cognitive level, I think this is still a different situation.

With a compiler you can expect a more or less one to one translation between source code and the operation of the resulting binary with some optimizations. When some compiler optimization causes undesired behavior, this too is a very difficult problem to solve.

Intentionally 10xing this type of problem by introducing a fuzzy translation between human language and source code then 1000xing it by repeating it all over the codebase just seems like a bad decision.

Re:A ChatGPT mistake cost us $10k by throw46365 on Sunday June 09, 2024 @10:01PM (#40629427)
Right. I mean... I sometimes think that Webpack is a malign, inscrutable intelligence! :-)

But at least it's supposed to be deterministic. And there's a chance someone else will be able to explain the inner workings in a way I can repeatably test.

Re:A ChatGPT mistake cost us $10k by throw46365 on Sunday June 09, 2024 @08:51PM (#40628952)
> You could say the same about the output of a compiler.

Except, for starters, that you're not using the LLM to replace a compiler.

You're using it to replace a teammate.

Re:A ChatGPT mistake cost us $10k by theamk on Sunday June 09, 2024 @10:53PM (#40629683)
Yes, and when compilers fail, it's a very complex problem to solve, that usually requires many hours from experienced dev. Luckily,

(1) Compilers are reproducible (or at least repeatable), so you can share your problem with other, and they can help.

(2) For common languages, there are multiple compilers and multiple optimization options, which (and that's _very important_) produce identically-behaving programs - so you can try compiling same program with different settings, and if they differ, you know compiler is bad.

(3) The compilers are very reliable, and bugs when compiler succeeds, but generates invalid code are even rarer - in many years of my career, I've only seen a handful of them.

Compare to LLMs, which are non-reproducible, each one is giving a different answer (and that's by design) and finally have huge appear-to-succeed-but-produce-bad-output error rate, with value way more than 1%. If you had a compiler that bad, you'd throw it away in disgust and write in assembly language.

Re:A ChatGPT mistake cost us $10k by throwaway2037 on Sunday June 09, 2024 @09:47PM (#40629346)

    > I think using AI tools to write production code is probably indicative of people who don't really know what they are doing.
People said the same to me for using Microsoft IntelliSense 20 years ago. AI tools for programming are absolutely the future.
Re:A ChatGPT mistake cost us $10k by throw46365 on Sunday June 09, 2024 @09:53PM (#40629379)
But not the now, quite obviously.

Colour me cynical but I don't feel like pretending the future is here only to have to have to fix its blind incompetence.

Re:A ChatGPT mistake cost us $10k by whakim on Sunday June 09, 2024 @09:21PM (#40629169)
I totally disagree with this. You might as well argue that we shouldn't use code-completion of any kind because you might accidentally pick the wrong dependency or import. Or perhaps we shouldn't use any third-party libraries at all because you can use them to write reasonable-looking but incorrect code? Heck, why even bother using a programming language at all since we don't "own" how it's interpreted or compiled? Ultimately I agree that using third-party tools saves time at the cost of potentially introducing some types of bugs. (Note that said tools may also help you avoid other types of bugs!) But it's clearly a tradeoff (and one where we've collectively disagreed with you the vast, vast majority of the time) and boiling that down to AI=bad misses the forest for the trees.
Re:A ChatGPT mistake cost us $10k by aniviacat on Sunday June 09, 2024 @11:19PM (#40629815)
It is possible to use autocompletion correctly.

It is possible to use libraries correctly.

It is not possible to use AI correctly. It is only possible to correct its inevitable mistakes.

Re:A ChatGPT mistake cost us $10k by whakim on Monday June 10, 2024 @01:19AM (#40630420)
AI can provably write code without mistakes?
Re:A ChatGPT mistake cost us $10k by mbreese on Sunday June 09, 2024 @09:31PM (#40629238)
This is an error that should probably have been caught just based upon the color of the text when it was typed/pasted into the source code. Of the uuid() call was in quotes, it would have appeared as text. When you’re blindly using so much copy/pasted code (regardless of the source), it’s really easy to miss errors like this.

But our existing tools are already built to help us avoid this.

Back in the day, I used a tool from a group in Google called “error-prone”. It was great at catching things like this (and Lorne goal NPE in Java). It would examine code before compiling to find common errors like this. I wish we had more “quick” check tools for more languages.

Re:A ChatGPT mistake cost us $10k by thaumasiotes on Sunday June 09, 2024 @11:24PM (#40629838)
> This is an error that should probably have been caught just based upon the color of the text when it was typed/pasted into the source code. Of the uuid() call was in quotes, it would have appeared as text.

It's not in quotes. It's a function call.

The issue is that the function call happens once, when you define the class, rather than happening each time you instantiate the class.

Re:A ChatGPT mistake cost us $10k by mbreese on Wednesday June 12, 2024 @09:07AM (#40657700)
You’re right… I was remembering it as a `server_default` attribute. Those were quoted in the other lines, but this wouldn’t have been.
Re:A ChatGPT mistake cost us $10k by mattdw on Sunday June 09, 2024 @09:32PM (#40629246)
I'm a some-time Django developer and... I caught the bug instantly. Once I saw it was model/ORM code it was the first thing I looked for.

I say that not to brag because (a) default args is a known python footgun area already and (b) I'd hope most developers with any real Django or SQLAlchemy experience would have caught this pretty quick. I guess I'm just suggesting that maybe domain experience is actually worth something?

Re:A ChatGPT mistake cost us $10k by aragilar on Sunday June 09, 2024 @10:34PM (#40629584)
I missed it, because I was really confused what the models were doing: why is there an id and a subscription_id? Are the user_id fields related?
Re:A ChatGPT mistake cost us $10k by Sakos on Sunday June 09, 2024 @11:23PM (#40629833)
I've since moved on to primarily working with Java, so it's been a few years since working with Django on a daily basis and the default still jumped out to me immediately. Experience and domain knowledge is so important, especially when you need to evaluate ChatGPT's code for quality and correctness.

Also, where were their tests in the first place? Or am I expecting too much there?

Re:A ChatGPT mistake cost us $10k by jwells89 on Sunday June 09, 2024 @11:25PM (#40629843)
This is why I typically only use LLMs in programming as a semi-intelligent doc delver with requests like, “give me an example of usage of X API with Y language on Z platform”.

Not only does it goof up less frequently on small focused snippets like this, it also requires me to pick the example apart and pay close enough attention to it that goofups don’t slip by as easily and it gets committed to memory more readily than with copypasting or LLM-backed autocomplete.

Re:A ChatGPT mistake cost us $10k by ufmace on Monday June 10, 2024 @12:22AM (#40630115)
I don't know Python or SQLAlchemy that great, though I do have the benefit of it being cut down to a small amount of code and being told there was a bug there. That said, I didn't see the actual bug, but I did mentally flag that as something I ought to look up how it actually behaved. It's suspicious that some columns used `default` with what looks like Python code while others used `server_default` with what appears to be strings that look more like database engine code. If I was actually responsible for this, I'd want to dig into why there is that difference and where and when that code actually runs.

It's also the case that "code review" covers a lot of things, from quickly skimming the code and saying eh, it's probably fine, to deeply reading and ensuring that you fully understand the behavior in all possible cases of every line of code. The latter is much more effective, but probably not nearly as common as it ought to be.

Re:A ChatGPT mistake cost us $10k by Terretta on Sunday June 09, 2024 @07:39PM (#40628535)
> It read like no one really knew what they were doing. "We just let [devs] generate the code and everything seemed to work" is certainly not a good way to [whatever].

Except, have you met startup devs? This is by and large the "move fast then unbreak things" approach.

Re:A ChatGPT mistake cost us $10k by masijo on Sunday June 09, 2024 @07:47PM (#40628583)
This is why working for startups gives me PTSD. I wouldn't recommend it to anyone.
Re:A ChatGPT mistake cost us $10k by almost_usual on Sunday June 09, 2024 @08:31PM (#40628829)
The idea of inheriting a ChatGPT code base no one understands now makes it worse.
Re:A ChatGPT mistake cost us $10k by hehdhdjehehegwv on Sunday June 09, 2024 @09:19PM (#40629158)
Just give it to GPT-5 for a refactor, easy!
Re:A ChatGPT mistake cost us $10k by pclmulqdq on Sunday June 09, 2024 @10:16PM (#40629498)
It terrifies me that I have heard people say this unironically.
Re:A ChatGPT mistake cost us $10k by hehdhdjehehegwv on Monday June 10, 2024 @12:42AM (#40630230)
It’s the natural outcome of SV types denigrating the value of education.

Forget knowing anything, just come up with a nice pitch deck and let the LLM write the stack.

Not wholly surprised these people are YC backed. I’ve got the impression YC don’t place much weight on technical competence, assuming you can just hire the talent if you know how to sell.

Well, now replace “hire some talent” with “get a GPT subscription and YOLO”, and you get the foundation these companies of tomorrow are going to be built on.

Which hey, maybe that’s right and they know something I don’t.

Re:A ChatGPT mistake cost us $10k by SilasX on Sunday June 09, 2024 @07:58PM (#40628642)
For that matter, has OP even met the HN accepted wisdom? "No one knows what they're doing, everyone's faking it, it's fine if you are too" -- so don't take it as a red flag when your fumbling around keeps blowing up, because it surely must work that way everywhere else.

My early rant against this mentality: https://news.ycombinator.com/item?id=19214749

Re:A ChatGPT mistake cost us $10k by tmpz22 on Sunday June 09, 2024 @08:50PM (#40628945)
Its very humbling coming out of startup-land and working with big tech engineers and realizing their tooling runs circles around everybody else and enables them to be much more precise with their work and scale, though it isn't without trade-offs.
Re:A ChatGPT mistake cost us $10k by sanderjd on Sunday June 09, 2024 @09:13PM (#40629123)
Yeah but a lot of that is just the accrual of improvements that is possible with a lot of resources over a long period of time.

People working in "big tech" aren't fundamentally better at building reliable tools and systems; the time and resource constraints are entirely different.

Re:A ChatGPT mistake cost us $10k by crabmusket on Sunday June 09, 2024 @10:56PM (#40629698)
And the stakes! This outage might have cost the OP $10k. A similar snafu at a larger company might have cost tens of millions or more.
Re:A ChatGPT mistake cost us $10k by fragmede on Sunday June 09, 2024 @11:56PM (#40629995)
The big tech tooling probably cost tens of millions of dollars to create, and probably had a couple $10k mistakes on the way to getting it written and running.
Re:A ChatGPT mistake cost us $10k by ruszki on Sunday June 09, 2024 @10:54PM (#40629689)
It’s possible to move fast the same way, but break less things than this. For example, in this case, they said that they introduced tests to mitigate this. I can assure you that introducing tests takes more time than Google searches to check in like 2 minutes what each lines really does.
Re:A ChatGPT mistake cost us $10k by Kesty on Monday June 10, 2024 @03:23AM (#40631069)
The idea of moving fast is to have extensive logs and alerts so you fix all error fasts while they appear without "wasting time" with long expensive tests in a phase where things change every day.

5 days to find out you have "duplicate key" errors in the db is the opposite of fast

Re:A ChatGPT mistake cost us $10k by PhasmaFelis on Sunday June 09, 2024 @07:57PM (#40628639)
> It read like no one really knew what they were doing.

In my experience, hardly anyone in software does know what they're doing, for sufficiently rigorous values of "know what you're doing." We all read about other people's stupid mistakes, and think "haha, I would never have done that, because I know about XYZ!" And then we go off and happily make some equally stupid mistake because we don't know about ABC.

Re:A ChatGPT mistake cost us $10k by zeroonetwothree on Sunday June 09, 2024 @08:57PM (#40628999)
There’s a difference between not knowing what you are doing and making a mistake.
Re:A ChatGPT mistake cost us $10k by throw46365 on Sunday June 09, 2024 @09:06PM (#40629067)
The "zen" of LLMs is that they do not see a real distinction between these two things, or either of these two things and success ;-)
Re:A ChatGPT mistake cost us $10k by PhasmaFelis on Sunday June 09, 2024 @09:03PM (#40629046)
An awful lot of mistakes are made because one didn't know something that would have enabled one to avoid it. Not knowing what you don't know is difficult to work around.
Re:A ChatGPT mistake cost us $10k by throw46365 on Sunday June 09, 2024 @09:03PM (#40629048)
I dunno. I tend to annoy people when taking on jobs by telling people what I am concerned about and do not understand, and then sharing with them the extent to which I have managed to allay my own concerns through research.

I turn down a lot of jobs I don't feel confident with; maybe more than I should.

An LLM never will.

Re:A ChatGPT mistake cost us $10k by bogota on Sunday June 09, 2024 @09:03PM (#40629051)
This is getting more common. I have already had people try to tell me how something works from a chat gpt summary. This would have led to us taking a completely different direction… 5 minutes of reading the actual docs and I found out they were wrong.

Now at a new company i have caught several people copy pasting gpt code that is just horrendous.

It seems like this is where the industry is headed. The only thing i have found gpt to be good at is solving interview questions although it still uses phantom functions about 50% of the time. The future is bumming me out.

Re:A ChatGPT mistake cost us $10k by gravescale on Sunday June 09, 2024 @10:18PM (#40629506)
Like people who post "here's what ChatGPTx said" instead of their own answer. Quite literally, what is the point?

However, I don't think it's really bad for the technical industries long term. It probably does mean that some companies with loose internal quality control and enough shiftless employees pasting enough GPT spew without oversight will go to the wall because their software became unmaintainable and not useful, but this already happens. It's probably not hugely worse than the flood of bootcamp victims who wrote fizzbuzz in Python, get recruited by a credulous, cheap or desperate company and proceed to trash the place if not adequately supervised. If you can't detect bad work being committed, that's mostly on the company, not ChatGPT. Yes, it may make it harder, a bit, but it was oversight you should already have been prepared to have, doubly so if you can't trust employee output. It also probably implies strong QA, which is already a prerequisite of a solid product company.

Normal interest rates coming back will cut away companies that waste everyone's time and money by overloading themselves on endlessly compounding technical debt.

Re:A ChatGPT mistake cost us $10k by foota on Sunday June 09, 2024 @10:24PM (#40629541)
Is the idea here that normal (read: low?) interest rates will let companies spend more time getting things right?
Re:A ChatGPT mistake cost us $10k by gravescale on Sunday June 09, 2024 @10:51PM (#40629671)
No, the idea is that historically-normal interest rates around the 5-10% mark won't be conducive to free VC cash being sprayed around for start-ups to wank themselves silly over "piv-iterating" endlessly over spamming complete nonsense and using headcount and office shininess as a substitute for useful and robust products.

Yes, it makes the barrier higher even for good products and helps entrench incumbents, but short of a transnational revolution, the macroeconomic system is what is it and you can only chose to find the good things in it or give up entirely.

Re:A ChatGPT mistake cost us $10k by johnny22 on Monday June 10, 2024 @01:00AM (#40630316)
> Like people who post "here's what ChatGPTx said" instead of their own answer. Quite literally, what is the point?

Yeah I've seen this and i hate it. If i wanted to know what chatgpt said I'd just ask it myself.

Re:A ChatGPT mistake cost us $10k by droopyEyelids on Sunday June 09, 2024 @09:16PM (#40629141)
It’sa Tower of Babel like effect
Re:A ChatGPT mistake cost us $10k by krick on Sunday June 09, 2024 @09:49PM (#40629355)
I don't really care about them marketing their company, but, Jesus, seriously, that's how software is going to be written now. TBH, I'm not really sure if it's that much different from how it was, but it sounds just... fabulous.
Re:A ChatGPT mistake cost us $10k by gravescale on Sunday June 09, 2024 @09:51PM (#40629368)
> We just let it generate the code and everything seemed to work

Everyone using C++20 compilers: side-glancing monkey.

Re:A ChatGPT mistake cost us $10k by pclmulqdq on Sunday June 09, 2024 @10:17PM (#40629502)
The difference is that you can read the code that ChatGPT generates.
Re:A ChatGPT mistake cost us $10k by jasonlotito on Sunday June 09, 2024 @11:16PM (#40629799)
> It read like no one really knew what they were doing.

Then no one knows what they are doing. I really don't know any company that doesn't make what could be considered rookie mistakes by some armchair "developer" here on HN.