Live data from Hacker News

AI Agents and the Refactoring That Never Happens

rosenfeld.page

31–40 of 76 posts

Re: AI Agents and the Refactoring That Never Happens

#32
When project leads and directors only ask for features, the humans start to eventually push back, but agents do as you please, no matter what the cost.

They were trained to do what you ask, but unlike with humans, you need to ask for the refactoring yourself. -- They won't necessarily come up with it on their own.

(They also tend to not be around for long enough to live through the consequences of their tech debt actions.)

Re: AI Agents and the Refactoring That Never Happens

#36
>A computer can hold far more in “working memory” than a human can

That's a bit of a straw man. State of the art agents are limited to ~3.8Mi (1M tokens). That's usually where I run into issues--an LLM can't possibly hold as much context as a human and it's more of an art than a science getting the most important things squeezed in. It's especially prudent for complex codebases/systems.

An agent only knows what it can see. It doesn't know oldCruftyFunction is still critical to Bob's Excel macro that generates financial reports and yanks the codebase in as a bastardised dependency. A lot of times agents give a fall sense of security by making it seem like something complicated and unsafe is actually safe.

Re: AI Agents and the Refactoring That Never Happens

#37
post #17
post #4

> Here’s the problem. AI agents are not bound by human context limits in the same way. An agent can read the tangled function, trace every caller, and make sense of the mess that would have stopped a human cold. It can add the next branch correctly, and the one after that, working confidently inside code that no human on the team fully understands anymore. They're not bound by the same limits but they're still bound…

They also very often do not actually read the fucking files! Even after specifying to „read in full the fucking files“. LLMs are so lazy, they take any shortcut they can. Sorry, just thinking about it is reviving my frustration…

Yeah, you gotta make em prove their work so they don't hallucinate.

Try "build a script to trace callers" and "cite each file and line that calls the function"

Won't fix everything but usually helps in my experience

Although you still run into hard-to-find things especially in dynamic/duck typed languages or codebases with heavy use of reflection or code bases used as libraries

Re: AI Agents and the Refactoring That Never Happens

#38

Let's say that tomorrow, due to an improved model or whatever, we realize that the most efficient form of code of an app - for an llm to understand and work with - is for it to be in one long spaghetti file. Why wouldn't we do that? I think there's a point where this comes down to values instead of facts. If you want it to be human readable, that's fine and there are a bunch of therefores from that point. But if you…

Vendor lock in

Re: AI Agents and the Refactoring That Never Happens

#40

Meanwhile I'm over here refactoring as much as I can from years (or decades) of human-slung code. Turning the mess I either inherited, helped create, or built on top of into something clean and pristine might be my favorite LLM use. Same for personal projects, codebases that evolved over many years when I happened to have time that weren't kept quite as "clean" as I wish that finally been cleaned up. I've always _wan…

Same here. It's been very freeing mentally to get the 90% of things I always felt needed done actually done.
Post reply on HN