2 ms·
There can be a lot of value in refactoring code, but you should always refactor to _reduce_ bugs, rather than introduce them, and increase maintainability, rath
by mcv 13y ago
There can be a lot of value in refactoring code, but you should always refactor to _reduce_ bugs, rather than introduce them, and increase maintainability, rather than obfuscate it.
When I see terrible code and set out to fix it, I try to change it into what the author probably meant, rather than how I would have done it. And usually that's a lot faster, because I don't have to rethink and rewrite everything.
And sometimes the ugly approach really is better. I've introduced tight coupling where loose coupling was causing problems. The components were never going to be used separate from each other anyway, and this removed a whole pile of complexity that we didn't need. The simplest way is often best.