Live data from Hacker News

The Economic Benefit of Refactoring

martinfowler.com

91–100 of 132 posts

Re: The Economic Benefit of Refactoring

#91

I find it funny how the best practices for programmers, ignored in most IT companies, get reinvented as the best practices for AIs. Boring: The documentation should be in code, not in external Word documents uploaded to the company SharePoint server. Exciting: The documentation for the AI should be in code, not in external Word documents uploaded to the company SharePoint server. Boring: You should give your develope…

Hey look if putting a sticker of Elsa on it or saying it’s for the AI gets the kids excited to eat their vegetables just quietly take the win.

Re: The Economic Benefit of Refactoring

#92

Earlier quoted context omitted.

> Next up is demonstrating the AI is more productive with better programming languages. This is hard to do given the current reliance on model weights in its programming language knowledge. You’ll get your best results for python or some variation of python. But

Not true. Python performance is actually pretty low, and Elixir, Kotlin and C# trounce it handily.

Do you have citations? Everything I’ve read have said they have an overwhelming bias to Python; eg https://arxiv.org/html/2503.17181v1 and https://arxiv.org/html/2505.13004v1

Re: The Economic Benefit of Refactoring

#93

I find it funny how the best practices for programmers, ignored in most IT companies, get reinvented as the best practices for AIs. Boring: The documentation should be in code, not in external Word documents uploaded to the company SharePoint server. Exciting: The documentation for the AI should be in code, not in external Word documents uploaded to the company SharePoint server. Boring: You should give your develope…

No this isn't mindless reinventing --- this is finally having clear empiric evidence for something that we knew the entire time. This is a huge relief! Next up is demonstrating the AI is more productive with better programming languages.

Haha, queue a big argument over what “better” means for programming languages.

Re: The Economic Benefit of Refactoring

#94
I really enjoy refactoring. Like, doing it by hand (5 miles uphill in the snow both ways) rather than AI. I don't even understand why I enjoy it, because if done right, there's no visible change. When people ask me why I'm so pumped up after having worked on the codebase all day long, I can't give them any sort of answer that makes sense (coming from a small business with a smaller dev team). It's just... "I'm future-proofing our website and we won't see any direct results today but things will be so much easier going forward..."

There's something about the puzzle. Looking at my old, deranged coding workarounds that tried to solve problems that have already been solved a thousand times before with established paradigms; and then moving them toward said best practices; and doing it in a way that no NEW technical debt is created. It's just satisfying.

I think one of the best learning experiences for me has been the fact that I created a bunch of sloppy shit by hand, auth and all, which forced me to learn things the hard way. All along the way, people were shouting from the rooftops: "use established libraries, dummy!", which is the same advice I would give to somebody today. But by doing things the hard way, I learned so much more about the inner workings. And, I've also given myself a decade's worth of refactoring work, which I really enjoy!

Re: The Economic Benefit of Refactoring

#95

I really enjoy refactoring. Like, doing it by hand (5 miles uphill in the snow both ways) rather than AI. I don't even understand why I enjoy it, because if done right, there's no visible change. When people ask me why I'm so pumped up after having worked on the codebase all day long, I can't give them any sort of answer that makes sense (coming from a small business with a smaller dev team). It's just... "I'm future…

Probably it's just the same dopamine hits that make things like watching the Windows 98 Defragger soothing.

Re: The Economic Benefit of Refactoring

#96

I find it funny how the best practices for programmers, ignored in most IT companies, get reinvented as the best practices for AIs. Boring: The documentation should be in code, not in external Word documents uploaded to the company SharePoint server. Exciting: The documentation for the AI should be in code, not in external Word documents uploaded to the company SharePoint server. Boring: You should give your develope…

if it works, it works

Re: The Economic Benefit of Refactoring

#97

Agent code can only be read and understood by agents. We’ve reached the point where people just can’t comprehend these giant code blobs. Feature, bug or emergent property? I don’t think the distinction matters as much as the reality. We’re being locked into using the AI tooling bc the code was generated with AI tooling. These giant files of doom were being generated by humans anyway and were very hard to work with. W…

Clearly not true. I got codebases that are 100% done by LLM. I have no problem reading the code base and find where things are. Not harder to find stuff than when I done it manually.

Re: The Economic Benefit of Refactoring

#99
post #8
post #5

the punchline: "Refactoring reduces token consumption" I appreciate the effort to quantify the benefit rather than pontificate. It's worth mentioning Martin Fowler wrote a whole book on refactoring [1], in which he states, "to refactor, the essential precondition is [...] solid tests", which I think is the real benefit here, AI or not. Good tests protect against regressions, whether human or robot. They also help enc…

(Just to note that although the article is on martinfowler.com Martin is not the author. It's attributed to Thoughtworks CTO Giles Edwards-Alexander.)

Oh. That's kind of disappointing.

Re: The Economic Benefit of Refactoring

#100
I've been experimenting with not only refactoring but rewriting history. I'm always moving around commits, inserting, splitting things up. The amount of times I've instructed to "tell the story right the first time"...

More quantitative and qualitative analysis to come

Post reply on HN