Hacker News new | ask | show | jobs
by safety-third 2317 days ago
>You could end up throwing away years of edge case handling

I work with software that has been continuously worked on since the 60's. It has the dreaded legacy if's like below everywhere.

    if(obtuse variable) then
       change a few other obtuse variables
There have been at least three attempts at major rewrites done of the software. The main goal was always to get rid of those corner case ifs everywhere. Every single attempt failed because we lost our ability to handle massive amounts of our customer's projects. Each of those ifs does something important.

One of my main projects throughout my stay has been to reduce these with small, disciplined improvements. I have made major headway in this fashion. You have to find the leaves of your software and work your way up while rigorously testing your changes. This is the exact opposite of the human gut reaction of a massive top down rewrite. It's impossible to tell how far you are off-course until it's done. It's the waterfall method of refactoring.