logoalt Hacker News

aabhay • today at 1:54 AM • 7 replies • view on HN

Code is not a 1-dimensional skill. The models do extremely well at writing code that fits into a single file, roughly up to 5000 lines. Beyond that, even the best models have significant failure modes such as duplicate implementations, low code reuse, abstraction anti patterns (e.g. checking the db for the same consistency condition before, inside, and after a function), etc.

And left to their own devices, the code they write might be utterly unreadable and unmaintainable. I’ve seen e.g. a model write a shell script that invokes python with bash vars that itself generates a kubernetes yaml config that itself contains shell scripted python. All while giving a “The task is complete” success message.


Replies

lovasoa • today at 9:11 AM

I think we have all seen agents write terrible code like this. And a few months ago, I was horrified too. Now I tend to just merge it. Later I'll prompt "remove the dependency to python" it'll just do it.

➕ show 2 replies
lukan • today at 6:28 AM

"The models" have greatly different capabilities. In general sure, they are much better at a single contained standalone file - but so are humans. Most big projects will have very dirty parts - and I am pleased that AI can now help me with my human created mess. You know that you can also give them the job to do refactoring? And before writing code, tell them to make a specific plan for it, you can review and edit?

petra • today at 12:14 PM

If we guide the model to - minimize lines of code, or limit itself to 5000 lines, does it choose the highest level libraries it can? or is that something we need to specify, in order for it to be done well?

trollbridge • today at 2:26 AM

I used agents to develop applications far more complex than 5,000 lines, although I generally take a modular approach (just like when writing code with a team).

still_grokking • today at 2:12 AM

I agree that we're still far away from replacing humans end to end.

OTOH the LLMs reached a state where they can get really useful if one is willing to put the "babysitting" effort in.

munksbeer • today at 12:37 PM

> And left to their own devices, the code they write might be utterly unreadable and unmaintainable

With respect, I think this is soon going to be considered a legacy view. Humans invented coding patterns so that other humans could maintain the code. AI coding agents don't have our restricted ability in this respect and can happily understand and rewrite what humans consider complete messes of code bases.

They will write code in a way that they understand and over time they'll get better and better at writing and maintaining large codebases in a way that suits them best.

You only have to care if a human needs to read and modify the code by hand, and that won't be the case.

I know a lot of coders hate this, but in my opinion, this is just how it will be.

sakesun • today at 2:18 AM

Harness can help. And AI could harness itself.

➕ show 1 reply