logoalt Hacker News

pxc • yesterday at 10:06 PM • 2 replies • view on HN

I have a computer science degree and have bounced around security engineering, software engineering, and DevOps roles. I currently produce code for a living, although it's internal tools rather than application code for end users.

LLMs typically write 2x-25x as much code as they should. Occasionally they write 50x as much code as they should. It's not mimicking competent developers, or even the "over-complication" of perfectionists. It's plain bad.


Replies

rstuart4133 • today at 2:45 AM

It's rare that you can compare LLM output to a human's, but I got the opportunity. It was some one-off throwaway code to scrape some websites, to find a good deal on buying a car the first time around and buying a tractor the second time around. It took me 800-odd lines for the car. The LLM generated over 50k lines for a very similar task.

The technique was a wild success for the car, and a total failure (so far) for the tractor. My guess on why is kinda surprising to me.

The LLM (in the end) produced reliable working code that did exactly what I asked. But when I wrote the car-searching code, something else happened – I learnt about the second-hand car market, features available and what they sold for, and what they were worth to me. By the end of the process my expectations squarely matched market reality, the filters so finely tuned that I only had to look at a couple of candidates, and I was very happy with the outcome. The LLM's search results were full of noise. For example, I told it I only wanted nearby ads. It dropped the ones that gave a distant location, but kept the ones that gave none, even when their landlines put them 1000s of km away. Worse, it missed many real candidates as it repeatedly missed features in the ads that were obvious to a human. For example, if they mentioned mowing it probably came with a slasher Had I written it myself, I'd have hit both of these early on, because I'd have been reading the ads. With the LLM writing it, I never read them, so I never knew to ask. I still don't have a good feel for prices and what type of seller offers them, so I find myself going back and doing the searches manually to see what the LLM missed.

A middle ground would be to write the filters myself, so I get a feel for the market, and get the LLM to write the rest. The trouble is the same one you get with a bash script. You start with 10 lines; months later it's a 1000-line monster, bash was clearly the wrong choice, and by then it's far too hard to change. This started as a fully vibe-coded program. To bolt my own filters on I'd first have to understand its structure well enough to know what sort of filtering API would fit. That's possible, but no one wants to read and understand 50k lines of crap that could have been done in 1k. It would be less painful to write the whole thing myself.

Balooga • yesterday at 10:35 PM

Exactly. Here is what I have found in my own project. Because I hadn't explicitly told the LLM (Hi Claude!) to not create a brand new build tool, it created a brand new build tool.

The LLM created a build tool that sequenced dependent files by time instead of result. So a test would kick off 2 seconds after a compile was initiated instead of the build waiting for a compile to complete. Race conditions left and right under load which the LLM decided to mitigate by increasing wait times. Which lead to increased build times, but that didn't fix the race conditions.

So the LLM decided to compile/test each file 50x times in a row, only continuing with the build if all 50x runs resulted in no race conditions.

Also, run the entire build 3x in a row -- because why in the hell not. The first time under ptrace to inventory files that are created or modified. The second time to create a hash of each file inventoried during the first run. The third time to compare file hashes to the second run to determine build failures.

A build that should have takes less than a minute using plain make and Makefiles just about turned my laptop into slag after 30 minutes of 100% CPU load.

Fun times.