Hacker News new | ask | show | jobs
by geekpowa 2320 days ago
Evolution will not let you escape local minima, intrinsic/sprawling design decisions that cannot be evolved away from.

I am sitting on a codebase whose oldest line of code is about 20+ years old and has evolved successfully in that time such that product it was 20 years ago and todays product are unrecognizable from one another. Its database schema is even older, encoding decisions made 30 years ago. Reasonable decisions at the time, but no longer reasonable.

I am working on a major rewrite which will take a year. The nature of the changes required mean I cannot break it up into pieces and do it bit by bit as I have been for last couple of decades with major enhancements. A functioning product is all or nothing. As someone who is anti-rewrite, pro-evolve and accustomed to working on old codebases, and being my own business so its my own money on the line, the decision to embark on a 12 month rewrite is not taken lightly.

3 comments

Can you please do a blog post at the end of the project to let us know how it pans out as a case study?
I think my original comment mischaracterized my project.

It is a refactor, but a refactor that is going to take about a year to complete, where there will be nothing to show for it until it is finished. From old codebase, probably about 20% to 30% of it will be ripped out and replaced.

Its not my first major project in terms of keeping this codebase capable. Previously written compilers/runtimes and IDE modules to keep it going : to gain control of codebase which was written in a commercial/proprietary dev environment into something I have full control over. That effort took a year.

The difference in this case is I am deliberately, intentionally throwing code away, alot of it, for the first time and contrary to my instincts. Still a post mortem might be interesting. My successful efforts to code my way out of a proprietary dev environment was an interesting and risky project, discussed at length with relevant dev communities at the time, but probably worth writing up one day.

Can you tell what area is this? Is it a backend service or something like software that runs on consumer's PCs?
Rich Client / Consumer PC. SQL backend (originally was proprietary DB), fairly tight coupling between UX and model, old school rich client event loop. An unhealthy amount of global state ( what the original programming language encouraged )
I think evolution can escape a local minima - however - I would imagine that most organizations aren't able to support the individuals who can lead an evolution toward a more long range goal that would require transiting the natural boundaries of a minima that an undirected evolution would naturally transit.

With regard to your own project, I find it somewhat hard to believe that you can rewrite a 20 year old code base in just one year's time. Assuming an output of 50 LOC a day - and 250 work days a year - which means the system you are replacing is under 15k LOC.

50 LOC a day seems pretty pessimistic when you have an existing system to work from, and 20 years experience with the domain!
As you’re anti-rewrite, do you have concerns that a years development time won’t be able to cover 20+ years of development work? I think it was Coding Horror that said this is the greatest fallacy with rewrites - decades of invisible features and bug fixes are suddenly forgotten. I’ve not been involved with a rewrite so I can’t really speak from experience but that seemed to make sense.