Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Rewrites Considered Harmful? 670

ngunton writes "When is "good enough" enough? I wrote this article to take a philosophical look at the tendency for software developers to rewrite new versions of popular tools and standards from scratch rather than work on the existing codebase. This introduces new bugs and abandons all the small fixes and tweaks that made the original version work so well. It also often introduces incompatibilities that break a sometimes huge existing userbase. Examples include IPv4 vs IPv6, Apache, Perl, Embperl, Netscape/Mozilla, HTML and Windows. "
This discussion has been archived. No new comments can be posted.

Rewrites Considered Harmful?

Comments Filter:
  • Ego? (Score:5, Informative)

    by Undaar ( 210056 ) on Thursday January 15, 2004 @03:30PM (#7988883) Homepage
    I think it may have something to do with programmer ego and something to do with the challenge. I'm guilty of it myself. You find something you're interested in and you want to build it. It doesn't matter if someone else has done it or even done it well before you. The challenge is to do it yourself.
  • by nakhla ( 68363 ) on Thursday January 15, 2004 @03:31PM (#7988902) Homepage
    Windows XP/Server 2003 were NOT complete rewrites of the OS. Many of the individual components within the OS may have received extensive retooling, but the OS as a whole was not a complete rewrite. New features were added. Existing features were modified. The code simply evolved from one version to another, just as with most products.
  • by Jahf ( 21968 ) on Thursday January 15, 2004 @03:32PM (#7988911) Journal
    XP and 2003 are fairly minor tweaks of Windows NT, but they are missing some of the back-compatibility that was in Windows 2000 if I remember right.

    Windows NT was as close to a complete rewrite (of Windows 3.1) as Microsoft has attempted for a long time. Since then there were 2 main branches that derivated ... Windows 3.1 -> Windows 95 -> 98 -> ME and Windows NT 3.5 -> NT4 -> 2000 -> XP -> 2003.

    XP was in no way "from scratch".

    Longhorn sounds like it will use a NT-derivative kernel, but may end up being close to a rewrite. One would hope so given the time they are going to take for it.
  • by Fnkmaster ( 89084 ) * on Thursday January 15, 2004 @03:32PM (#7988915)
    It was not a rewrite, and thus is a terrible example. In fact, if you poke around it's referred to in several places internal to the OS as "Windows NT 5.1" to Win 2k's "Windows NT 5.0". That should give you a pretty good clue that it's not a rewrite.


    And the fact that somebody thought it was should give you a good clue that Microsoft's marketing machine is quite a powerhouse indeed - they want the average consumer to THINK that XP was some totally new thing. It wasn't. In fact, if you install all the latest DirectX runtimes, patches and so forth into Win 2k, you will basically conclude that the difference between a fully patched up-to-date Win 2k and Win XP is themeability and some graphics geegaws. And that product activation stuff if you are running a non-corporate version of XP.

  • by mitchner ( 524884 ) * on Thursday January 15, 2004 @03:36PM (#7988992) Homepage
    Joel on software has covered this point in a good article: http://www.joelonsoftware.com/articles/fog00000000 69.html [joelonsoftware.com].
  • Joel Spolsky (Score:5, Informative)

    by Boing ( 111813 ) on Thursday January 15, 2004 @03:37PM (#7989010)
    Joel of Joel on Software [joelonsoftware.com] has written a much more insightful and useful (IMO) analysis of the motivations and fallacies behind code rewrites.

    Things You Should Never Do, Part I [joelonsoftware.com]

  • Re:Full of shit. (Score:3, Informative)

    by iantri ( 687643 ) <(ten.xmg) (ta) (irtnai)> on Thursday January 15, 2004 @03:45PM (#7989140) Homepage
    IE is nowhere near as bad as Netscape 4.

    If you feed, say, IE 4 a complex page with CSS, it generally will render it OK (an OK implentation of the standards). Netscape 4, however, will crash and burn. No exceptions.

    The fact that many organizations "standardized" on Netscape 4 just makes things worse...

  • by rushfan ( 209449 ) on Thursday January 15, 2004 @03:45PM (#7989143) Homepage Journal
    Very true... One of the few "rewrites" that Microsoft has rever done is the NT codebase (which was actually more of OS/2 morphing into NT), and that wasn't a true rewrite since the "original" DOS/Win31 codebase keps livingo on with Win96/98/ME.

    MS has tried some rewrites (I think they tried in Excel rewrite, I think Code Complete references that) but scraped them (also never giving up on the previous generation codebase).

    That's one thing they do well (for better or worse) is not waste any money on rewrites (look at Win9x)

    Rushfan
  • by Fnkmaster ( 89084 ) * on Thursday January 15, 2004 @03:47PM (#7989178)
    When you say "new", you mean changed. I don't think the kernel was rewritten from scratch, was it? Driver model? I'm under the impression that most Windows 2000 drivers are more-or-less ABI compatible with Windows XP without modification. Apparently the DDKs aren't that different between the two OS's, though there were of course changes (http://www.osronline.com/article.cfm?id=249). There were a substantial number of additions to the network stack (http://www.microsoft.com/technet/treeview/default .asp?url=/technet/prodtechnol/winxppro/evaluate/ne twkxp.asp but not a rewrite that would categorize it as "new" as far as I know.


    The point is that all the items you mentioned were changed, but most were not rewritten from scratch, which is what this thread is all about.

  • Re:Full of shit. (Score:2, Informative)

    by Mysticode ( 696150 ) on Thursday January 15, 2004 @03:51PM (#7989221)
    Are you sure you aren't comparing Netscape 4.x which is how old against newer versions of IE?

    When Netscape 4.5 came out I remember comparing it to IE and found that Netscape worked better overall.

    I agree that Netscape 4.x doesn't work nearly as well as say IE 5 but IE5 is a lot newer.

    Just my two cents, I personally use Pheonix/Firebird and Opera.
  • Re:Joel Spolsky (Score:2, Informative)

    by chromatic ( 9471 ) on Thursday January 15, 2004 @04:01PM (#7989380) Homepage

    I kinda prefer JWZ's the CADT Model [jwz.org].

  • by NeuroManson ( 214835 ) on Thursday January 15, 2004 @04:02PM (#7989408) Homepage
    I disagree.

    Case in point, Windows 2000, AKA NT 5. When in its original development, it was being built on Windows NT 4.0 technology. When they realized that this "upgrade" added more problems than it solved, and subsequently was unable to keep up with newly emerging technologies and standards, they decided to scrap it and start from scratch.

    Similarly, this is why Windows XP is 5.11.2600 (if I recall correctly), because it was built on NT 5.

    As opposed to Win 9x which was just a modded kernel and added dll clutter.
  • by Jahf ( 21968 ) on Thursday January 15, 2004 @04:02PM (#7989416) Journal
    Compared to rewriting NT/XP into Longhorn will be, no. but compared to something like DOS 2 to DOS 3 (or was DOS 2 the rewrite?), it was a HUGE undertaking at the time. Creating a 32bit kernel from a 16bit one was pretty big news at the time.
  • Re:Full of shit. (Score:2, Informative)

    by Apathetic1 ( 631198 ) on Thursday January 15, 2004 @04:05PM (#7989474) Journal

    He's definitely blowing smoke - he blames XUL for Mozilla's poor performance on his workstation. XUL is not the limiting factor as anybody who has used Firebird can attest. Firebird is much quicker than Mozilla and still uses XUL for user interface.

  • by stevew ( 4845 ) on Thursday January 15, 2004 @04:29PM (#7989845) Journal
    I've had the fortune to be affiliated with the Icarus Verilog compiler/simulator effort over the last 3-4 years. The first version of the code had some specific design decisions that made scaling simulations beyond a thousand or so gates impossible.

    The author chose to throw out his simulation engine and much of his code generation and adopt a completely new model. It took him the better part of a year to get roughtly where he was with the original code base as far as functionality is concerned. He also has a regression environment with several hundred tests he uses regularly to let him know how he is doing with respect to functionality. About 2 1/2 years into the rewrite period, Icarus is now handling behavioral code of 1 Million gates at about 80% of the performance of commercial tools!

    Was the rewrite needed. YES! Did it take awhile. YES! Was it worth the wait. YES!
  • by Anonymous Coward on Thursday January 15, 2004 @04:41PM (#7990023)
    Except that it has, like, O(n^2) table formatting algorithm. You don't see it when you're just doing layout kludges (and keeping it simple), but once you display lots of formatted data the crawl sticks in.
  • by Gherald ( 682277 ) on Thursday January 15, 2004 @04:45PM (#7990088) Journal
    The user's are locked down now, their programs work, and every thing is centrally administered thanks to group policy and active directory. Overall it's been very nice.

    Locking the users down, group policy, and active directory are as much a part of XP as 2K.

    The new UI just sucks IMNSHO

    I agree.

    Start --> Run --> gpedit.msc --> User Config --> Admin. Templates --> Control Panel --> Display --> Desktop Themes --> Force Windows Classic

    I have a .reg file for this and other settings to speed the process, since this used to be a very small business that has grown very fast and we never bothered to set up a network-wide group policy system.

    Our servers are 2K so I can't comment on 2003. I'm trying to sell the execs on using kernel 2.6 and samba 3.x for our next server. I figure something approaching 2.6.10 ought to be out by the time we are ready, so it should be stable enough.
  • Perl 6 v Perl 5 (Score:4, Informative)

    by Yrd ( 253300 ) on Thursday January 15, 2004 @04:52PM (#7990220) Homepage
    How is it possible to so completely miss the point of Perl 6? The intent is not necessarily to replace Perl 5 - Perl 5 is fantastic and the Perl 6 developers above all people know this. Perl 6 is perhaps best thought of as a DIFFERENT LANGUAGE which will 'just happen' to be, in many places, very similar/identical to Perl 6.

    Once you start thinking of Perl 6 in that manner, you realise what it's for. It's not to replace all of the Perl already out there. It's to provide a new tool, a new language for doing new things in, drawing on the experience gained in years of working with Perl 5 and other languages.

    Ponie, of course, is part of the effort to make sure that at least some of the vast amounts of Perl 5 code is usable with Perl 6, should programmers wish it. And even that's not a total rewrite of the existing Perl codebase.

    So ultimately, that article has nothing of use in it. Yes, programmers should be careful what they rewrite and when they rewrite it, but many times such things are actually worth it. GTK+ 2, anybody?
  • Re:Design desitions (Score:3, Informative)

    by Bas_Wijnen ( 523957 ) on Thursday January 15, 2004 @04:55PM (#7990278)

    I know the feeling. But it hardly ever happens anymore, and that is only because I now document every "smart" move I make. If I do something which may look weird, I write a comment about why I don't do it the other way, or that it should have been the other way, but I was too lazy to do it.

    If I see something which looks like it shouldn't work, then I study it, and find out why it does, and document it. Or I study it, find out that indeed it doesn't work in some cases, document and fix it, or document that I couldn't see why it works, and that it may be buggy.

    Often it will be less work to document (and thus understand) other people's work than to rewrite it. Sometimes, however, this is not possible (because the original is closed source and you're not the owner of the source) or it is clear that it's not going to help much (because the original is really really bad, for example Netscape 4). In those cases is a complete rewrite acceptable.

    And of course you may want to rewrite a program which is only available as non-free software. Not because it's buggy, just because it doesn't allow others to study, change and improve it.

  • License (Score:1, Informative)

    by Anonymous Coward on Thursday January 15, 2004 @05:03PM (#7990379)
    License.

    I've rewritten a lot of code from the sepcifications to get out from under the license.

    I've rewritten commercial code to get out from under the commercial license, and I've rewritten GNU code to get out from under he GPL.

    Unless everyone suddenly goes to a BSD license (or public domain, which leaves them open to legal liability, for lack of a "hold harmless" clause), I expect to be happily hacking away for many, many years to come.
  • Sorry bud (Score:3, Informative)

    by Kombat ( 93720 ) <kevin@swanweddingphotography.com> on Thursday January 15, 2004 @05:07PM (#7990461)
    I have a 400 MHz PC at home. Netscape 4.7 runs acceptable fast. Mozilla is a hog. So I'm sticking with Netscape 4.7.

    It's also useful to have that browser around when doing web development, to ensure that my sites look OK in the older browsers. There are still a lot of Netscape 4.7 browsers floating around out there.

    That said, I use Mozilla on both my 1.8 GHz laptop and my 2.0 GHz work PC.
  • Opera 3,5,6,7 (Score:3, Informative)

    by danila ( 69889 ) on Thursday January 15, 2004 @05:50PM (#7991093) Homepage
    Another great example not mentioned by anyone yet is the excellent Opera Internet browser. It isn't always rewritten from scratch, but overall there are enough changes in each new major version to make it almost unusable, at least to me. Every time a new version (3.0, 5.0, 6.0, 7.0) is rolled out, many little things no longer work as they did, and sometimes they are clearly and unequivocally broken.

    Before I knew better, I used to download the release versions (not betas or RCs), but each and every time I ended up uninstalling the new version and switching back. It usually took more than a month and about 10 updates for a new version to reach relative maturity. Witness 3.21, 6.05, 7.20, only these versions could be considered better than their predecessors in all respects. With version 7 I succumbed at about 7.1, but next time I will really know better and not even consider Opera 8, until there have been a month without updates. :)

    On a more serious note, I think there is moment of maturity in many every product's lifetime, a moment when new features could no longer justify an upgrade (other things, such as compatibility, being equal).
  • How about GNU? (Score:2, Informative)

    by ivoras ( 455934 ) <ivoras @ f e r.hr> on Thursday January 15, 2004 @06:08PM (#7991371) Homepage
    One of the biggest rewrites ever is certainly Linux and the FSF userland tools that accompany Linux distributions.

    While, for example, BSD's 'ls' program can be tracked all the way to the seventies, GNU people of course rewrote it just for the license sake.

    A nice example is the 'ping' tool. The story of ping [arl.mil] tells how the program was concieved and made, and the FreeBSD's current ping.c is based on it:

    /*
    * Copyright (c) 1989, 1993
    * The Regents of the University of California. All rights reserved.
    *
    * This code is derived from software contributed to Berkeley by
    * Mike Muuss.
    ... */
    /*
    * P I N G . C
    *
    * Using the Internet Control Message Protocol (ICMP) "ECHO" facility,
    * measure round-trip-delays and packet loss across network paths.
    *
    * Author -
    * Mike Muuss
    * U. S. Army Ballistic Research Laboratory
    * December, 1983
    *
    * Status -
    * Public Domain. Distribution Unlimited.
    * Bugs -
    * More statistics could always be gathered.
    * This program has to run SUID to ROOT to access the ICMP socket.
    */
    That's a codebase 21 years old and still viable!
  • Re:Design desitions (Score:3, Informative)

    by AJWM ( 19027 ) on Thursday January 15, 2004 @07:17PM (#7992142) Homepage
    Using dynamic memory, always, in place of static arrays is for people incapable of doing data flow analysis.

    And if they can't figure out where their data is coming from and going to, the code probably has other problems too.

    (Not to say that static arrays aren't often used inappropriately, but the opposite extreme is just as bad.)
  • by Anonymous Coward on Thursday January 15, 2004 @07:27PM (#7992230)
    Except that ME and XP Home are from completely different product lines. Apart from that, your analogy isn't too far off the mark.
  • by IntlHarvester ( 11985 ) on Friday January 16, 2004 @02:04AM (#7995503) Journal
    There is NO OS/2 code in Windows NT

    Not true. The "LanMan" SMB Networking is right out of OS/2. This was even bragged about in the early NT documentation because it meant NT could slide-in to your SMB network seamlessly. For a long time, OS/2 and NT domain controllers were interchangable.

    There's also the HPFS filesystem code in NT3, and NTFS, which is admittedly based on HPFS. It's also highly doubtful there's 0 OS/2 code in the "OS/2 Subsystem".

    if there was, IBM would have a claim on Windows NT

    Microsoft and IBM had a "divorce" agreement - as reported in the press, this allowed them to share co-developed products -- which I think included DOS 5, Windows 3.0, and OS/2 1.3.

Mystics always hope that science will some day overtake them. -- Booth Tarkington

Working...