Remix.run Logo
▲ aabhay a day ago

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.

▲lovasoa 18 hours ago | parent | next [-]

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.

▲svara 17 hours ago | parent | next [-]

I think the key question is whether it's really just "terrible code" - relevant only to people concerned about the code itself, rather than the functionality of the software. It seems plausible, at least, that terrible code has functional consequences you're not aware of. Maybe a lot of them, maybe complex and obscure ones.

It does seem to me that as of right now, AI is better at coding than most human coders if we just measure the success rate against some specific, well-defined, relatively simple test.

But in the past, talented coders used to make a large number of micro-decisions that they'd discover and decide while implementing any non-trivial feature. Making those decisions well was an important part of the job, and led to good software. It was also a somewhat rare skill.

I don't think AI writes "good software" in that sense, yet.

My concern is that, as of right now, the approach you suggest:

> Later I'll prompt "remove the dependency to python" it'll just do it.

Is actually not that efficient, because it means you're deferring all those micro-decisions to later, and constantly churning through some half-broken state of the program.

I'm not so naive as to suggest that this issue is somehow fundamental to AI; I'm just concerned about what is happenign right now and asking myself what the best way forward is.

▲kaffekaka 18 hours ago | parent | prev [-]

Do you need to remove it?

If so: so it depends on you to be aware of the need?

▲hadlock 17 hours ago | parent [-]

Until the current supply chain security nightmare of code dependencies ends, yes, being able to pull out python sounds like a great idea. We're abandoning vllm in favor of vllm.cpp and llama.cpp largely because I get to walk away from 9gb of supply chain attack surface area (CUDA) forever, for a couple days of testing.

▲lukan 21 hours ago | parent | prev | next [-]

"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?

▲trollbridge a day ago | parent | prev | next [-]

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 a day ago | parent | prev | next [-]

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.

▲petra 15 hours ago | parent | prev | next [-]

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?

▲munksbeer 15 hours ago | parent | prev | next [-]

> 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 a day ago | parent | prev [-]

Harness can help. And AI could harness itself.

▲sylware 16 hours ago | parent [-]

software QA AIs.