Rewriting your Platform

At ZendCon I talked about “Planning a PHP 4 to PHP 5 codebase rewrite, a practical approach”. The talk was based on my own experience, as well as famous discussion of the topic such as Joel Spolsky’s “Things you should never do” and the examination of “famous” platform rewrites.

During my monday morning surf, I bumped into this dailywtf called “No Need to Change It!“. This is an interesting story about a software development company who created car dealership systems. The original system was built in Cobol and the story goes on to explain the various loops that they jumped through to avoid having to rewrite their entire system. These steps included creating a COBOL->C converter (so that they could run under x86), and then the generation of windows forms to run on top of the system so that they could use “new windows technology.”

While it’s obvious that this story was intended to be derogatory, from a business standpoint sounds like a success and probably even something that Joel would be proud of.

Rewriting a mission critical system which has been a cash cow for over 20 years is not a small decision, regardless of the technological benefits involved. The company would have to maintain their floor of COBOL programmers, while hiring another team to do R&D using the new systems. The new development team will have the herculean task, of reproducing the code that a programmers have been hammering on for 20 years. After 2 years (I’m being generous this morning) the platform has been re-written. Deployment opens up a new can of worms.

Customers do not like changing platforms. A car dealership with sales team of 5000 people will not look kindly on having to retrain their staff simply because the upstream software provider decided that it was time that they rewrite the underlying code. The clients are faced with the same question as the software development company. “Do we deploy a new system when the old technology has been working fine for 20 years?” Since the clients have a vested interest in not “rocking the boat” and you will probably find a large percentage of the company clients choosing not to roll out the upgrade onto their systems. This will mean that the software development company will need to support both platforms for 3 to 5 years.

So when suggesting such a huge move to company management you are suggesting:

  • Doubling development costs for 2 years
  • Doubling support costs for 3-5 years
  • Embarking on a herculean software development projects (80% of which fail)
  • The possibility of clients choosing not to use the new versions

In exchange for:

  • A platform built on (currently) modern technology
  • Long term extensibility (providing your new code is better than your old code)
  • Reduction if future maintenance costs

Embarking on such a move can break an otherwise successful company. Choosing not to rewrite your platform can have long term repercussions on the success of the company.

Not a choice that I would like to be responsible for.

17 Responses to “Rewriting your Platform”

  1. Tony Marston Says:

    While a rewrite from COBOL to a more modern language may be justified, a rewrite just to move from version 4 to version 5 of PHP sounds totally stupid. PHP 5 is capable of running code that was written for PHP 4, so if you have PHP 4 code that *cannot* run under PHP 5 then you are doing something wrong.

    And don’t tell me you need to rewrite in order to take advantage of the new OO features of PHP 5because as far as I am concerned the *new* features are just syntactic sugar which do not add any significant new functionaliy at all - they ust suit some peoples vision of how OOP should be done. That just proes to me that their style of OOP is wrong.

    It is possible to have a single code base, using the OO features which exist in PHP 4, which runs untouched under PHP 5. I know because I have done it. If you can’t do it then you cannot be much of a programmer.

  2. Aaron Wormus Says:

    Tony, I don’t think you can say one way or another what is the “right thing” to do.

    If you have a codebase which is unable to move to PHP5 because of design decisions when it was originally written for PHP3, if you are doing a lot of manual XML parsing, or want to make usage of ext/soap or any of the hundreds of other non-OO oriented PHP5 upgrades, then a platform re-write WILL save you a LOT of time in the long run.

    And regarding PHP4 sites which don’t run in PHP5… it all depends on the design. Given a large enough codebase and a couple design decisions to use techniques which aren’t compatible with PHP5 can make the site difficult if not impossible to port over to PHP5.

    Relaunching a website doesn’t have nearly as many downstream issues as a huge platform like the COBOL platform in the article.

    Obviously, if you can move to PHP5 without a rewrite then do so, but if given the choice to stay on PHP4 indefinitely or rewrite to PHP5… then I think a rewrite is in order.

  3. James Douglas Says:

    Tony,

    I expect you havent used php4 OOP features excessively. And you doesnt seem to have complex code. Elswise you would know that its totally dumb what you say.

    It is true that you can write for php4&5 simultaneously.
    But its not true that you can move a big and solid system to php5 with only a little bit effort.

    When you do toy stuff like “my itsy bitsy site cms” that may work, but not when you have to provide a large base of customers and ensure a quality tested software system.

    From your post I would say you never heard of reference problems.

    But dont be sad. I think you will learn that as well on the next big change when you are adult enough for a big customer.

  4. Tony Marston Says:

    > I expect you havent used php4 OOP features excessively But its not true that you can move a big and solid system to php5 with only a little bit effort From your post I would say you never heard of reference problems

  5. Tony Marston Says:

    That stupid entry screen cut off my post after the first paragraph, so here it is again:

    – I expect you havent used php4 OOP features excessively –

    Define “excessively”. I use the OO features of PHP 4, butin a way that makes them compatible with PHP 5. I don’t use fancy tricks which may not work as expected in future versions.

    – its not true that you can move a big and solid system to php5 with only a little bit effort –

    It is when you know what the differences are and write code that will work in both versions.

    – From your post I would say you never heard of reference problems –

    I have, but I have learned to write code which avoids any such problems. This then makes it a non-problem.

  6. PHPDeveloper.org Says:

    Aaron Wormus’ Blog: Rewriting your Platform…

  7. hsrIU2iTtX Says:

    Hi! Very nice site! Thanks you very much! 0rCs8bTMeU4wba

  8. adult friend finder login Says:

    adult friend finder login…

    gimmemoney 551767 This page contains some info about adult friend finder login…

  9. poeweipukn Says:

    vritoqo

  10. short term Says:

    My god u kept me entertained.

  11. buy cod Says:

    You have a great website. Keep up the good work.

  12. fingering bbw Says:

    fingering bbw…

    fingering bbw moves…

  13. mlpvwhtsiv Says:

    hxgknr

  14. Junior Says:

  15. new york moving company Says:

    new york moving company…

    shit-happens 2304222 new york moving company source…

  16. aol bingo e game pogo z Says:

    good work, will back soon, great site congratulation!!

  17. Paris Hilton Sex Tape Video 2 - Paris Hilton Exposed *HOT* Says:

    hottest Paris hilton sex tape download…

    Recently leaked footage of the new Paris Hilton sex tape…

Leave a Reply