5 ms·
I have often done huge refactors over the last 20 years on systems where there are none. It's very satisfying turning a 1,000 line class file into 100 lines. B
by mattmanser 2mo ago
I have often done huge refactors over the last 20 years on systems where there are none. It's very satisfying turning a 1,000 line class file into 100 lines.
But all my refactors have been in statically typed languages.
To speculate on the reason why, which the GP asked, I think perhaps it is two things. It's the same satisfaction from tidying a room or your workbench. But it's also slightly narcissistic unfortunately. I think you've shown you're better than the other programmers. Much, much, better when you end up with massive reductions in TLOC.
And with tests, the irony is that the resulting code is often so much easier to reason about, you start spotting really obvious bad assumptions in the original implementation.
It's one of the reasons I've always been fairly skeptical about the true value of unit tests (integration, I get). That and the fact that projects I've worked on that did have unit tests catch like 1 bug a year. Maybe it's just the size of systems I traditionally work on (smaller teams, or even 1 person teams, so man-years worth of effort rather than decades or centuries).