Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re (tilly) 5: (OT) Rewriting, from scratch, a huge code base

by tilly (Archbishop)
on Oct 01, 2001 at 18:57 UTC ( #115879=note: print w/ replies, xml ) Need Help??


in reply to Re: Re (tilly) 3: (OT) Rewriting, from scratch, a huge code base
in thread (OT) Rewriting, from scratch, a huge code base

I agree that it is good for people to learn to use and maintain wheels instead of building them. I also agree that the experience of maintaining code teaches you a lot about how (not) to write maintainable code. However there are at least three good reasons I would cite for when it is important to rewrite code:

  1. You need something available in the language you are working in, and the original code is not. The example I cited above was rewriting code in Perl that had been in Expect scripts. Without the rewrite you cannot add consistent error handling nearly as easily.
  2. The component has been identified as exceptionally buggy. This is based on research at IBM where they found that they could get impressive improvements in code quality by tracking bug count, and then rewriting from scratch the worst 10% of components. The point being that the components usually had some fundamental design flaw, and your demonstrated odds of writing a better component were very good.
  3. You have completely reconceptualized how the component should work, believe that the benefits will be very large, and accept the costs of an attempt. This is the most dangerous reason, it is easy to fool yourself. However sometimes dramatic change in how something fundamentally works is easiest achieved through a rewrite. (Perl 5 as opposed to Perl 4.) Even so, I think this is an absolute no go unless you make it a priority to support the old model from within the new. The new model needs to not only be better than the old, it needs to subsume it.
But note that while I think there are cases where rewrites are justified, I freely and absolutely agree that people tend to launch into rewrites without sufficient justification...


Comment on Re (tilly) 5: (OT) Rewriting, from scratch, a huge code base

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://115879]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2014-09-17 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (70 votes), past polls