They're not bound by the same limits but they're still bound by some limits, yeah?
I'm not an AI expert, so I don't honestly understand why LLM driven agents are as good as they are. But my impression is "trace every caller", most of the time, is still an approximation. Once the code has gotten convoluted enough, cases are going to get dropped.
Sorry, just thinking about it is reviving my frustration…
Refactoring used to have a very real cost - it was substantial amounts of time that would have to be carved away from working on new features.
Now I can spot a potential refactor, fire off a prompt in an asynchronous coding agent (or on a worktree or whatever), then come back 20 minutes later and either accept it, poke it a bit, or abandon it. Costs me almost nothing.
Refactoring was never a substantial amounts of time for me before llms. Before I could spot a potential refactor and refactor it in 20 minutes and less. Never abandon it. Just constant improvement to the point the previous tech startup that I was working for just drive from itself (I am still paid a a few hours per months for it)
In the only scenario where that could actually be true you wouldn't have coworkers creating unmaintainable code with LLMs now.
As ever, no one is willing to allocate time for this, but (with unlimited work tokens) I can parallel path massive cleanup refactors all the time now.
I've yet to work at a place that bothered with much refactoring over adding the thirtieth conditional to new feature....
Your discipline only pays off if you already understand your code and/or established clear baseline for your standards before launching into a feature development mania. And it needs to be enforced every turn, or the firehose of code generation knocks the front door down easily.
I've always _wanted_ my code to be clean and easy to follow but life, deadlines, shifting-priorities, etc have stood in the way of that. Now I can finally realize my personal nirvana.
That said, I've had to steer models away from too-heavy of abstraction or similar because it made the code too hard to follow.
Often times it's not even that the code is bad but rather that it's overengineered. I see it happen so much that I'm tempted to actually go the other way on a toy project. Like what would Claude or Codex come up with if I told it I wanted an enterprise grade, globally scalable, compliant and auditable tic-tac-toe game.
https://github.com/enterprisequalitycoding/fizzbuzzenterpris...
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 don't necessarily want that for a particular codebase, why refactor if the LLMs can handle it?
The position in the article is reasonable because what would end up happening otherwise is:
- Agents increase complexity, humans can't read it anymore
- Agents increase complexity, agent can't read it's own code anymore
- Agent unable to keep making updates without looping forever (the complexity of the code exceeds the agent's context length). Human doesn't understand either so can't fix.
This isn't hypothetical either, it's basically what ends up happening to most vibe-coded software if the person doing the vibe coding doesn't know how to review the outputs being produced.
I have some speculation that maybe the people doing the model post-training tend to be younger researchers that haven't worked on large complex software systems, so their taste isn't as developed in this regard about what things are important here.
But this is an area that can be steered with appropriate early instructions ("When choosing tradeoffs of implementation, build for long term maintainability and understandability of code over implementing just the exact code necessary to solve the issues. etc. chain of thought often includes information that would have to be repeated in a future agent session, make sure to persist it to code or external docs so that future sessions and user understanding is respected.")
It can also be done as a post-change step with similar effects. And you can use your agents to build this layer into your general modus operandi for dealing with the crimes of generated code. But one of the things that all AI labs should be doing is looking at AGENTS.md on real project as being hard expressions of what failure modes real projects have noticed in models generally. Don't wait fo the bugs to be raised on these things, use express preferences that show that there's a problem. Go trawl github for these in bulk to use for future post-training.
Not only that. Good modularity also:
- improves code reusability, reduces unnecessary code duplication
- helps agents and engineers make better data model, data structure, design pattern, naming, and algorithm choices
- surfaces incorrect irregularities or outdated exceptions to a rule
- enables clean, independent upgrades of parts of a system to improve performance
- reduces stale references in code and comments (and the confusion that results, both from agents and humans)
Bad modularity is basically a summary of what constitutes pathological LLM code. How often have you tried to grok an AI-built project and found trivially unreusable code, unnecessary duplication (everywhere!), bad data structure and algorithm choices, and stale references?
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.)
But I've personally never worked on code with test coverage that good. Refactors were always risky.
Not exactly a refactor, but high degrees of consistency are what I strive for in a codebase. LLMs get confused by inconsistencies, as do humans.
Interesting choice of words. Not a fix. Not a refactor. A commit.
But it also doesn’t mean these things aren’t problems, they’re obviously huge problems.
dgellow•1h ago
Thats… not my experience. Like, not at all. They very regularly get lost
SoftTalker•9m ago
Ancalagon•7m ago
Also this article reads like it was written by Sonnet.