logoalt Hacker News

ericmcer • today at 2:04 AM • 2 replies • view on HN

I don’t understand how it will ever overcome something like not replicating an existing function. It can’t possibly have full context on a massive codebase at all times so additional prompt runs checking for existing functionality would be necessary.

Even scarier is something like a legacy change made for a specific client, like “our biggest client needs checkboxes as the UI, do not switch it to a dropdown.” was in a commit message 2 years ago, AI will just overwrite that without thinking.


Replies

socketcluster • today at 2:32 AM

If your files are named well and codebase is of reasonable size, it will find them and re-use them. I haven't experienced the problem of duplicate functions at all on any of my personal projects. The trick is that my code is separated into distinct modules in a clear hierarchy with one-way dependency; no module has more than 5k lines total, no more than 20 files or so. Basically, I treat every part of my system as an independent, fully self-contained black-box product which could potentially be used by third-parties in different business domains. The interface of each module is generally quite simple and it doesn't expose any internal details.

My AI agent never has to work with more than 5k lines of code and like 20 files at a time; and most are much smaller than that; like 1k or 2k lines... Even though one of my projects is almost 30k lines, my AI agent never has to consider more than 5k.

It's a very different experience in my day job because the project has more lines, more files and all the files for the entire project are in the same repo and naming is not as clear. In this case, I have to point to the relevant files/context in every session.

devmor • today at 2:16 AM

There are solutions for this that those of us with the rare combination of experience, time and management buy-in are using - but they’re scary to people all-in on AI tools.

I’m talking about deterministic checkpoints and hooks. In every environment in which I need to use a coding agent I have had to essentially build a harness outside of the harness to be measurably productive. If you’re not using deterministic tools to box in what the agents are capable of doing, the problems you describe are ten times more rampant than anyone wants to admit.