Rewriting working code

I was recently asked to advise on converting a site that was written in ASP to PHP, Ruby on Rails, or ASP.NET. Sounded like a good job because the specification is the existing site and the only requirement is that the new system must run on a technology “that is supported” and has a future roadmap. So all I have to do is pick one, and get converting, writing lots of lovely code to replace the fully debugged, live, tested, operational site.

Anyone who hasn’t read Joel’s excellent (and largely spot on) “things you should never do part 1” should read it here;

To summarise:

  • When you throw away code and start from scratch, you are throwing away all that knowledge. All those collected bug fixes. Years of programming work.
  • You are wasting an outlandish amount of money writing code that already exists.
  • All systems (sites) may well have bits that are horrible – but these should be addressed as part of the lifecycle development not by thinking that throwing it all away and starting again is a magic cure. It isn’t and you’ll end up with some different horrible bits.
  • You gain nothing for your investment

If a site is working, supported (by a good developer), largely meeting client expectations then it needs not to be rewritten. It needs to be maintained and migrated within the technology stack that it is currently using.

Going back to the original question; I simply asked the client a version of the above questions, I feel that they had been badly advised as it turns out that they had been told that ASP was old and unsupported. ASP is old, and I did never like it much in the first place, but it does the job and more importantly Microsoft still support it…. I’m a big fan of opensource, and of things like Drupal, PHP, (but not so much MySQL as I like databases), but the simple fact is that Microsoft support is more consistent, and they have a good record of continuing support (service packs for XP for example).

So overall my advice to the client was to evolve what they’ve got within ASP and transition to ASP.NET (MVC / Razor) as a planned process before 2018.

I was still asked to quote; so I worked on my very rough guide of 1 minute per line to convert. This equated to 445 hours. I argued that is a good chunk of a migration within the existing framework.

At this point in my story the whole project somehow became very political. I’m not exactly sure of the details but my usual project manager presented this to the board (small company) and got a very negative reaction. The PM was fairly convinced that the director championing this whole project had been badly advised by one of his associates/friends/advisors. In the end the PM managed to convince the board to keep with their current system, using their current developer and plan to be migrated by 2018; simply on the basis that it would be a waste of investment to fix something that wasn’t broken and that as a board guiding the company it is their responsibility to advise on the company’s best interests. I suspect I don’t express that as well as the PM did;

Of course I didn’t get paid for any of this valuable advice, and maybe one day something will come of it; but I prefer to be honest and upfront and say when something doesn’t need doing.