4 ms·
I've found that access to coding agents has helped me be far less tolerant of bad code patterns that can be refactored. Refactoring used to have a very real co
by simonw 1mo ago
I've found that access to coding agents has helped me be far less tolerant of bad code patterns that can be refactored.
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.
- rafaelRiv 1mo agoAnd for me, it has created a giant pile of unmaintainable code from my coworkers because of stupid management people that think they can code. 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)
- simonw 1mo agoDoes that code at least come with tests?
- Kiro 1mo agoI've never met a single developer saying refactors are easy. It's always a minefield. In the only scenario where that could actually be true you wouldn't have coworkers creating unmaintainable code with LLMs now.
- SoftTalker 1mo agoIf you were fortunate enough to be working in a project with very good test coverage, refactors were easier (maybe not easy) in the sense that you were at least fairly confident that nothing broke. But I've personally never worked on code with test coverage that good. Refactors were always risky.
- rafaelRiv 1mo ago> In the only scenario where that could actually be true you wouldn't have coworkers creating unmaintainable code with LLMs now. Bingo. My highly qualified team was disbanded because the company went bankrupt. Apparently, the CEO had embezzled a large sum of money. That team was disbanded just before LLMs caught up. The one that create unmaintainable code is a new team and the reason they are able to create such a large amount of unmaintainable code is because of llms. > I've never met a single developer saying refactors are easy. It's always a minefield. Pleasure to meet to you. You now know one. In the land of functional programming, refactoring is quite enjoyable and quite easy.
- teaearlgraycold 1mo agoAll sorts of efforts that used to be put off indefinitely can now be handled largely by LLMs. Yesterday I took a codebase (~50 source files) and spawned a sub-agent (GLM 5.3 Flash) for every single file. Each file was analyzed for test coverage issues, inconsistencies between comments and implementations, and all call sites against the implementation. Then issues were aggregated. I reviewed the list manually, had Opus and K3 review as well to prune the list, and then had a commit made for every minor issue found. 70 commits with maybe 30 minutes of manual work. 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.
- nottorp 1mo ago> then had a commit made for every minor issue found Interesting choice of words. Not a fix. Not a refactor. A commit.
- teaearlgraycold 1mo agoNot sure what you’re getting at
- Sivart13 1mo agoTest coverage for its own sake is not always a worthwhile goal.
- kyleee 1mo agoUnless it was indeed valid coverage? You are assuming it was all bad
- teaearlgraycold 1mo agoCoverage started out kind of mediocre, about 50% IIRC. There were a lot of easy wins, and a handful of files were intentionally ignored. I also had it first review all tests for superfluous ones that could be deleted.
- 1mo ago
- boron1006 1mo agoDo you work with other, potentially unmotivated devs/managers a lot? I wonder how much of this is an incentive issue. I don’t think refactoring itself is as much of an issue than working with 2-3 other engineers that DGAF and a manager who is only looking at LOC to determine who to promote. But it also doesn’t mean these things aren’t problems, they’re obviously huge problems.