Live data from Hacker News

The Economic Benefit of Refactoring

martinfowler.com

1–10 of 132 posts

Re: The Economic Benefit of Refactoring

#2
Being a bit cheeky here -- the amount of comments on this post is a telltale sign of how common / desirable refactoring is for the majority of developers (xD). It isn't our fault though, maybe if those pesky managers read this article then they would understand..

Re: The Economic Benefit of Refactoring

#4
Interesting take-away:

> Claude is unable to look at code, look at refactorings in general and work out which are suitable to apply: a human needs to actively guide it.

Claude is happy to produce a very large Rust file. But you need human guidance to make it smaller.

Re: The Economic Benefit of Refactoring

#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 encode the spec, which humans and robots can read.

[1] https://www.oreilly.com/library/view/refactoring-improving-t...

Re: The Economic Benefit of Refactoring

#6
post #2

Being a bit cheeky here -- the amount of comments on this post is a telltale sign of how common / desirable refactoring is for the majority of developers (xD). It isn't our fault though, maybe if those pesky managers read this article then they would understand..

It's been on HN for 45 minutes. It's before 9am on the west coast

Re: The Economic Benefit of Refactoring

#7
It's very interesting to have some data on this.

It matches my experience which is that LLMs greatly benefit from well factored code, but are not particularly adept at creating such code.

Much like most human developers I suppose!

Re: The Economic Benefit of Refactoring

#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.)

Re: The Economic Benefit of Refactoring

#9
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.)

Thanks for catching that. Updated my post
Post reply on HN