Remix.run Logo
snoman 6 hours ago

My reading of it also violates the Boy Scout Rule. That is to say: if improving some portion of the codebase would make it better, but inconsistent, you should avoid the improvement; which is something that I would disagree with.

I think adherence to “consistency is more important than ‘good design’” naturally leads to boiling the ocean refactoring and/or rewrites, which are far riskier endeavors with lower success rates than iterative refactoring of a working system over time.

jpollock 6 hours ago | parent | next [-]

If improving a portion of the codebase makes it better, but inconsistent...

migrate the rest of the codebase!

Then everyone benefits from the discovery.

If that's difficult, write or find tooling to make that possible.

It's in the "if it hurts, do it more often" school of software dev.

https://martinfowler.com/bliki/FrequencyReducesDifficulty.ht...

CuriouslyC 3 hours ago | parent | prev | next [-]

The problem with small refactors over time is that your information about what constitutes a good/complete model of your system increases over time as you understand customers and encounter edge cases. Small refactors over time can cause architectural churn and bad abstractions. Additionally, if you ever want to do a programmatic rewrite of code, with a bunch of small refactors that becomes more difficult, with a single surface you can sometimes just use a macro to change everything all at once.

This is an example of a premature optimization. The reason it can still be good is that large refactors are an art that most people haven't suffered enough to master. There are patterns to make it tractable, but it's riskier and engineers often aren't personally invested in their codebases enough to bother over just fixing the few things that personally drive them nuts.

johnbcoughlin 6 hours ago | parent | prev [-]

if you have some purported improvement to a codebase that would make it inconsistent, then it's a matter of taste, not fact, whether it is actually an improvement.