A Rewrite Is a Decision, Not a Feeling

The urge to rewrite arrives as a feeling about old code, and the decision needs a cost, a boundary and a migration plan, and the three are exactly what the…

Share
A Rewrite Is a Decision, Not a Feeling. Abstract opinion illustration in orange and dark grey on debugly.dev

I would like to say the reason the rewrite is a decision rather than a feeling was the problem, because that would be a shorter post, but it started at the old.

This is the thesis: the urge to rewrite is a feeling, and the rewrite is a decision, and the decision needs a cost, a boundary and a migration, and the feeling supplies none of the three, so the feeling should not be the trigger.

This is an opinion, and the case for rewriting is sometimes right, and the rule of thumb at the end is where I land.

Why the feeling arrives

The code is old, and the old is the unfamiliar, and the unfamiliar is the slow, and the slow is the frustration, and the frustration is the feeling, and the feeling is the rewrite, because the rewrite is the fresh start, and the fresh is the familiar, and the familiar is the fast, and the fast is the appeal.

The feeling is also the second system, and the second is the everything the first got wrong, and the wrong is the list, and the list is the design, and the design is the rewrite's scope, and the scope is the everything, and the everything is the six months, and the six months is the cost, and the cost is the feeling's absence, because the feeling is the fresh start and not the migration.

The feeling is legitimate, and the legitimate is the signal, and the signal is the code's cost, and the cost is the real, and the real is the rewrite's possible justification, and the justification is the decision, and the decision is the measurement, and the measurement is the feeling's translation, and the translation is the work, and the work is what the feeling skips.

What the decision needs

A cost. The cost is the rewrite's time, and the time is the estimate, and the estimate is the wrong, because the rewrite is the unknown, and the unknown is the discovery, and the discovery is the old code's logic, and the logic is the undocumented, and the undocumented is the archaeology, and the archaeology is the months, and the months is the cost, and the cost should include the features not shipped during it, because the frozen is the real price.

A boundary. The boundary is the scope, and the scope is the module, and the module is the replaceable, and the replaceable is the seam, and the seam is the interface, and the interface is the contract, and the contract is the swap, and the swap is the incremental, and the incremental is the safer, because the boundary makes the rewrite a replacement rather than a big bang, and the big bang is the six months of nothing shipped.

A migration. The migration is the path, and the path is the both running, and the both is the comparison, and the comparison is the parity, and the parity is the trust, and the trust is the cutover, and the cutover is the switch, and the switch is the reversible, and the reversible is the rollback, and the rollback is the safety, and the safety is the migration's purpose, because the rewrite without the migration is the prayer.

This is the same discipline as the estimate that is not a commitment, same mechanism, different costume.

Where the rewrite is right

The rewrite is right when the cost of the old code is measured and exceeds the rewrite's cost, and the measured is the incidents, the time to change, the hiring difficulty, the performance ceiling, and the four are the numbers, and the numbers are the comparison, and the comparison is the decision, and the decision is the justified, and the justified is the rewrite.

The rewrite is right when the boundary exists, and the exists is the seam, and the seam is the module with the interface, and the interface is the swap's possibility, and the possibility is the incremental, and the incremental is the shippable, and the shippable is the business's tolerance, and the tolerance is the reason the bounded rewrite succeeds and the unbounded fails.

The rewrite is right when the migration is planned, and the planned is the both running, and the both is the parity check, and the parity is the confidence, and the confidence is the cutover, and the cutover is the reversible, and the reversible is the safety, and the safety is the difference between the decision and the gamble.

The working rule

The feeling is the signal and the decision is the work, and the work is the cost, the boundary and the migration, and the three are the rewrite's justification, and the justification is the business's, not the engineer's, because the cost is the features not shipped.

Measure the old code's cost before proposing. The incidents, the change time, the ceiling, and the numbers are the argument, and the argument is the decision's input, and the input is the fix, because the unmeasured feeling is the unpriced proposal.

Find the seam before committing. The interface is the boundary, and the boundary is the incremental, and the incremental is the shippable, and the shippable is the tolerance, and the tolerance is the approval, and the approval is the decision.

Plan the parity check. The both running is the comparison, and the comparison is the trust, and the trust is the cutover, and the cutover is the reversible, and the reversible is the safety, and the safety is the migration.

Ship something during the rewrite. The incremental is the value, and the value is the business's patience, and the patience is the time, and the time is the rewrite's survival, and the survival is the shipping, and the shipping is the rule, because the six months of nothing is the rewrite that gets cancelled.

Where I land

The feeling that the code needs replacing is usually accurate, and the accuracy is not the plan. The rewrite that succeeds is the one with a measured cost, a module boundary and a parity-checked migration, and the three turn the feeling into the decision, and the decision is what the business can approve.

The proposal was six weeks and the rewrite was six months, and the difference was the archaeology nobody priced. Name that one property in review and this class of bug gets hard to ship.


Published on debugly.dev by Rohit Bhadani | Founder of Krova Cloud