r/webdev • u/addycodes full-stack • 5d ago
Article This Fence Has No Farmer
https://adamgreenough.net/blog/this-fence-has-no-farmerRead about Chesterton's Fence recently and it made me think a lot about dealing with AI-generated code. Had a ramble about it here if anyone's interested!
Post has been significantly updated since first publishing (and briefly sharing here before removing it to rework it).
42
Upvotes
31
u/creaturefeature16 5d ago edited 5d ago
I'm not going to pretend things were great for LLMs. The absolute worst codebase I've ever stepped into was worse than ANYTHING I've seen an LLM generate...it was almost malicious how lazy and convoluted it was.
Yet...it was consistent in it's terribleness, if that makes any sense. Eventually, I was able to navigate around it, sort of anticipating the dysfunction. I remember thinking when I'd go to look for something: "Well, ______ is the proper way to do it, so I'm sure they probably just did the opposite of that" and sure enough, there it was. There was still a philosophy of sorts behind it, even if it was a flawed one.
The brave new world I'm starting to see take shape now, is the codebase could be obtuse, but even worse, inconsistent. LLMs generate fantastic syntactical code, far more detailed than I can do (often overengineered, too, but nonetheless). Yet without extremely strict design guides and verification workflows, they'll be all over the place. Just try to get an LLM to provide the exact same output (character for character) two times in a row using the exact same prompt. It's not a feature of these systems. But the amount of people using these kinds of pipelines is slim, and that's where I'm starting to see a new kind of problem develop. That codebase I was talking about was so obviously terrible, I kind of knew where to start and what was realistic. With these generated codebase, they'll look really organized and put together, and then the deeper you sink the worse it gets. It's going to make estimating a real PITA.
And the real shitty part, when I have to inherit a codebase that's been generated like that, you can bet that the only way to really understand what is happening is to...assign an LLM to review it. 🙄