Slashdot Mirror


Rewrites Considered Harmful?

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. "

119 of 670 comments (clear)

  1. Windows XP was a complete rewrite? by halo1982 · · Score: 4, Interesting
    I wasn't aware of this....ehh...I thought XP was just modified Win2k code (and I remember my early XP alphas/betas looked exactly like Win2k...same with Server 2003...)

    Was it a "good idea" for Microsoft to rewrite Windows as XP and Server 2003? I don't know, it's their code, they can do whatever they like with it. But I do know that they had a fairly solid, reasonable system with Windows 2000 - quite reliable, combining the better aspects of Windows NT with the multimedia capabilities of Windows 98. Maybe it wasn't perfect, and there were a lot of bugs and vulnerabilities - but was it really a good idea to start from scratch? They billed this as if it was a good thing. It wasn't. It simply introduced a whole slew of new bugs and vulnerabilities, not to mention the instability. It's just another example of where a total rewrite didn't really do anyone any good. I don't think anyone is using Windows for anything so different now than they were when Windows 2000 was around, and yet we're looking at a 100% different codebase. Windows Server 2003 won't even run some older software, which must be fun for those users...

    1. Re:Windows XP was a complete rewrite? by nakhla · · Score: 4, Informative

      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.

    2. Re:Windows XP was a complete rewrite? by Jahf · · Score: 2, Informative

      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.

      --
      It is more productive to voice thoughtful opinions (reply) than to judge (moderate) others.
    3. Re:Windows XP was a complete rewrite? by Fnkmaster · · Score: 3, Informative
      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.

    4. Re:Windows XP was a complete rewrite? by rushfan · · Score: 5, Informative

      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

    5. Re:Windows XP was a complete rewrite? by Fnkmaster · · Score: 3, Informative
      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.

    6. Re:Windows XP was a complete rewrite? by Threni · · Score: 2

      > I thought XP was just modified Win2k code

      Yep. Windows 2000 is Windows 5.0; XP is 5.1. Hardly a major rewrite.

    7. Re:Windows XP was a complete rewrite? by Gherald · · Score: 4, Insightful

      > 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.

      No, you have got it backwards. XP and 2003 are both MUCH more back-compatible than Win2k.

      Asside from NT, Win2k was the most incompatible windows ever. Stable, but with many compatibility problems with both hardware and software. Especially before the various service packs came out.

      > XP was in no way "from scratch"

      You are correct. XP is the Win2k codebase with many features added and much better hard/soft compatibility. It was designed to be both a home/office OS, whereas Win2k was designed specifically to be a robust server/workstation.

      Incidentally, after all this time there is still an ongoing debate about whether XP or 2000 are more stable as a workstation client. As a network admin for 46 stations, my vote goes for XP.

    8. Re:Windows XP was a complete rewrite? by Jahf · · Score: 3, Informative

      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.

      --
      It is more productive to voice thoughtful opinions (reply) than to judge (moderate) others.
    9. Re:Windows XP was a complete rewrite? by JohnnyComeLately · · Score: 2, Insightful
      I have to agree in concept with the author of the piece. I have installed Solaris 8 on quite a few systems and just ran with what it included, and maybe added a few packages (SSH, PHP, etc) for different things. Life was simple and everything worked, everytime.

      Then I changed jobs where there's not a single Unix machine to be found. Needing to set up a server (and knowing apache did what I needed), I took a PC and tried installing RedHat 8 from a disk I burned from a friend a long time ago. This is where my life got frustrating. I spent three weeks banging on this thing until someone mentioned Apache and Mod_Perl having different versions....oh yeah, and 1.99 is actually 2...WTF?? I came so close many times to just going on E-bay, buying an old Sun Ultra10, and donating it to work.

      Yes, I eventually got it to work (it's what I'm using now to write this, on a Mozilla browser), but it just seems like things were more complicated than they needed to be. Apache 1 worked....mod_perl 1 worked....

      So, since I agree with the author does that make me flamebait too? I guess the upside is now I have more books, as I went out and bought some Linux books to sit on the shelf next to my Sun Solaris System Admin 1 and 2 boxes.

      The reason I knew right away that I'd sympathize with this article is that all my co-workers (at my former job) were upgrading to Sol9. They'd ask, why aren't you upgrading? I'd always ask, why should I? Silence... Occasionally someone would mention OpenSSH, but then I'd remind them that took me less than 2 minutes to download, untar and pkgadd. A lot less time than a full OS load.

      John

    10. Re:Windows XP was a complete rewrite? by Gherald · · Score: 4, Informative

      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.

    11. Re:Windows XP was a complete rewrite? by Gherald · · Score: 2, Interesting

      Well I don't know what he does, but here we use VNC. That way we can take over the user's session directly, while they watch. Then I usually leave a quick message in notepad explaining what I just did. Some of them actually get it, and end up fixing the problem themselves next time. So I get more time to reload slashdot ;)

    12. Re:Windows XP was a complete rewrite? by Gherald · · Score: 2, Insightful

      The new UI really is a love/hate thing. I started using 95 the week it was released, so I am very attached to the old theme.

      There are plenty of people who like the new theme... but there is too much color there for my tastes.

      "Crayola interface", indeed!

    13. Re:Windows XP was a complete rewrite? by dtfinch · · Score: 3, Funny

      Notice how if you increment the letters in VMS you get WNT.

    14. Re:Windows XP was a complete rewrite? by Joe+U · · Score: 2, Interesting

      Just a FYI:

      There is no OS/2 code in Windows NT. Microsoft made that very clear to those in the Windows NT 3.1 beta.

      Windows NT 3.1 was a true first generation product.

    15. Re:Windows XP was a complete rewrite? by IntlHarvester · · Score: 2, Informative

      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.

      --
      Business. Numbers. Money. People. Computer World.
  2. Windows XP SP2 ought to be dangerous.. by [TWD]insomnia · · Score: 3, Insightful

    .. as they are rewriting the security layer!

  3. Design desitions by FedeTXF · · Score: 5, Interesting

    As a coder I can assure you that working on somebody else's code is frustrating because you allways say: "I would have done this differently". Most rewrites I think come from there, having the idea of a better implementation.

    1. Re:Design desitions by Old+Wolf · · Score: 3, Insightful

      A lot of time wasting comes from that too. Even if you can think of a better implementation, if it isn't better by it's not worth the development time + debugging time to do it that way.

      Re. the original post, I think a lot of the problem is caused by bad code commenting. When you make a "little tweak", or fix some minor bug, or fix a subtle logic bug, you should clearly comment in the code what you have done, so that it can serve as a warning when somebody else looks at the code and does not realise the subtlety involved.

    2. Re:Design desitions by selderrr · · Score: 5, Insightful

      I diesagree. Most rewrites come from the experience learned during long periods of adaptations. The roots of this rewriting problem go back to the source of all coding evil : specs.

      In 15 years of coding, i have NEVER worked on a project that had specs which could foresee future futher away than say 4-6 years. After that, either the managers start pushing up new features that simply do not fit the original concepts, or you bump into uses of your software you did not foresee simply because the scale of applications has grown beyond the site of your own usage.

      The last 4 years I've been writing an app for authoring psychology priming experiments (somewhat like e-prime, but with far more randomisation capabilities). In the original concept, no-one in our team expected someone to make randomisations wit a tree wider than 6 stages. So I went for 15 in my code. By now, 4 years later, I have seen projects with twice that depth. I could expand the code by changing some #defines to provide for larger arrays, but that ignores the fact that such complex randomisations demand a whole other interface. So after a few weeks of puzzling, we decided.. you guessed it : a rewrite.

    3. Re:Design desitions by blinder · · Score: 5, Interesting

      specs which could foresee future futher away than say 4-6 years

      LOL! Good grief man... the client I'm working with, their specs can't see past 4-6 weeks!

      Over the last year and a half I've been working on building a "policy engine" that manages this company's various business policies... everything ranging from ordering, or communications to whatever.

      Well, the ding-dang business users and their minions the "business analysists" can't see past a month or so... then oops... more functionality... change existing functionality... because "oops... we really need it to do this" to the point where I have to make this a unified system of "one off's"

      Yeah, ugh... and the idea of "rewrite" has come up because right now... the code base is huge... its a mess and looks like, well, like patch work. We are trying to get management buy-in... and calling it "upgrading and refactoring" because we know full well that "rewrite" is a dirty word in these parts :)

    4. Re:Design desitions by BinxBolling · · Score: 4, Insightful

      And often, you're mistaken when you think you have a better implementation.

      Here's an experience I used to have somewhat often: I'd be revisiting a piece of code I'd written a few months earlier. I'd think "Wait, this makes no sense. It shouldn't work at all. New approach X is much better." So I'd start refactoring it, and when I'm about 3 hours into the implementation of 'X', I begin to understand why I chose the original solution, and realize it remains the best approach. And so I nuke my changes.

      I don't tend to let that happen so much, any more. Partly I try to better document why I make the design decisions I do, and partly I try to have a little more faith in myself, and partly I stick to the attitude of "Don't fix what you don't empirically know to be broken."

      The point of my story is this: If someone can misunderstand their own design decisions after the fact (and talking to fellow programmers, I'm not the only one with this kind of experience), think how much easier it is to misunderstand someone else's.

    5. Re:Design desitions by FerretFrottage · · Score: 3, Insightful

      Give 10 software developers the same problem and you are guaranteed to get at least 11 different solutions

      --
      "Look Lois, the two symbols of the Republican Party: an elephant, and a fat white guy who is threatened by change."
    6. Re:Design desitions by aridhol · · Score: 4, Funny
      Specs? Uh...what are they? ;)
      Two lenses, held in a frame that keeps them in front of your eyes. Allows the slightly vision-impaired (such as myself) proper vision.
      --
      I can't say that I don't give a fuck. I've just run out of fuck to give.
    7. Re:Design desitions by aled · · Score: 2, Funny

      I'm a programmer and I disagree. Oh wait...

      --

      "I think this line is mostly filler"
    8. Re:Design desitions by Salamander · · Score: 3, Insightful

      There are necessary and beneficial rewrites, but the vast majority of rewrites occur because it's easier to write a new piece of code than to understand an old one. Yes, easier. The "rewrite bug" afflicts brash beginners the most, and top-notch experienced programmers the least. The best programmers tend to get that necessary rewrite out of the way during initial development, by writing a serious first-cut version, throwing it away, and then writing it a second time for real all before anyone else even sees it. Such code will often pass unit tests earlier than the "never refactor" code written by second-raters, and rarely requires a rewrite after that.

      --
      Slashdot - News for Herds. Stuff that Splatters.
    9. Re:Design desitions by Bas_Wijnen · · Score: 2, Informative

      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.

    10. Re:Design desitions by AJWM · · Score: 2, Informative

      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.)

      --
      -- Alastair
  4. But.. But... by devphaeton · · Score: 3, Funny

    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.

    Microsoft has created an entire, successful, multibillion-dollar-a-year-profiting business model off of this!!

    Sheesh.

    --


    do() || do_not(); // try();
  5. Slashdot by JM+Apocalypse · · Score: 2, Funny

    In light of the preceding article, I propose that we completely rewrite slashdot! In BASIC! This will provide unsurpassed slowness and crashing, making the world better for all!

    --

    - - - - - - -
    Orppf urp mf y.ppcxn. yflcbi otcnnov C am yflcbi yr n.apb Ekrpatv (Dvorak -> Qwerty)
    1. Re:Slashdot by [TWD]insomnia · · Score: 3, Funny

      I propose we redesign Slashdot in brainf*ck instead.

  6. Rewrite can be good, if done properly. by Metallic+Matty · · Score: 3, Interesting

    The trick is to include all the tweaks and fixes that were implemented in the old code. Obviously, if you rewrite and then leave open all the gaps and problems from the earlier version, there's no point in rewriting. However, you could rewrite with those fixes in mind, and come out with a completely new (and problem-free) edition.

  7. Ego? by Undaar · · Score: 4, Informative

    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.

    --
    ~ "When I'm of that age I'm just going to live up a tree."
    1. Re:Ego? by CommieLib · · Score: 2, Interesting

      There may be some of that, I suppose, but speaking as someone who is strongly advocating a rewrite for a new version, it's also a matter of just seeing vastly better ways of doing things now that you've had the benefit of the experience of v1.0.

      Furthermore, all of the features that creep into v1.1, .2, .3, etc. that were not envisioned at all in v1.0 become code barnacles, stuck on to the coherent codebase and clinging for dear life. Better to create a new codebase that incorporates them as part of it.

      --
      If your bitterest enemies are people who hack the heads off civilians, then I would say you're doing something right.
    2. Re:Ego? by globalar · · Score: 3, Insightful

      How do you learn how something works?

      1) You take it apart (literally the backwards approach, though if you have the time it works).

      2) Read the documentation, learn how to use it, and work with it. (Still will not show you everything, especially with well encapsulated components. And when was the last time documentation, even Google, answered all your questions?).

      3) Build something similar (a variant, clone, emulator, etc.)

      The experience of programming your own components cannot be substituted. Bad, but passable analogy: Building a house vs. repairing a house. In the former, you experience the though process; in the latter, you adapt your thought process (to some degree).

      Also, I think once you see all the work and brilliance that has gone into software you take for granted, you are motivated to build something once with the intention of reuse. To be a forward thinker you have to understand what has gotten us this far and what has to change to get us farther. Experience with what the wheel is made of and why, not necessarily rebuilding it, can provide you with these perspectives.

    3. Re:Ego? by StormReaver · · Score: 2, Interesting

      "There may be some of that, I suppose, but speaking as someone who is strongly advocating a rewrite for a new version, it's also a matter of just seeing vastly better ways of doing things now that you've had the benefit of the experience of v1.0."

      I've done (and still do) regular rewrites. In my case, it frequently ends up being rewritten because Management didn't accept my initial recommendations on development and/or back-end technology. Their chosen technology, which I am compelled to use, fails to adapt to easily foreseen circumstances and I have to rewrite my stuff to target the new technology.

      I can't blame them in the short run, though (even if the long run is certainly going to be very painful), as they had to get -something- up and running in just a few weeks, and the really bad technology was the only thing that was close enough to the desired target functionality to meet the deadline.

      Sometimes I rewrite old applications because they cannot possibly adapt to desired criteria or just perform so badly that they just scream for a redesign. All my existing VB apps fall into this category.

  8. Damed if you do, damed if you dont. by Kenja · · Score: 5, Funny
    Slashdoter: Why wont Microsoft just drop the Windows code base and start over? There are too many problems to fix.

    Microsoft: Ok, Windows XP and 2003 have a full rewrite of the TCP/IP stack and security system.

    Slashdoter: Why did Microsoft rewrite the core OS? They just introduced more bugs and lost the stability and security fixes from older versions of the OS?

    --

    "Have you ever thought about just turning off the TV, sitting down with your kids, and hitting them?"
  9. Netscape 4.x fast? by Anonymous Coward · · Score: 4, Funny

    Ok, this dude uses netscape 4.x and thinks its fast. next article please.

    1. Re:Netscape 4.x fast? by Eil · · Score: 2, Interesting


      4.x is much faster than Mozilla. By a long shot. Its downfall, aside from having unmaintainable source code, was that it was unstable, did not follow any kind of standards, and had a tendency to screw up whatever *should* have worked right. I think Internet Explorer 1.0 is the only browser in existance to beat the general crappiness of Netscape 4.x.

      Give me a slow and bloated, yet stable and standards-compliant web browser over the opposite (Netscape 4.x) any day.

  10. Tweaks only go so far... by Viral+Fly-by · · Score: 5, Insightful

    The minor tweaks, fixes, and changes that made the old version work so well can only go so far. Such is often the nature of code. Tiny fixes and patches are (sometimes haphazardly) hacked on to the code.

    Perhaps if true extensive software engineering and documentation techniques were followed, a full rewrite may not be necessary. However, as long as quick fixes continue to pollute the code and make it more and more difficult to work with, an eventual total rewrite will always be necessary.

    1. Re:Tweaks only go so far... by localman · · Score: 2, Funny

      I used to think so. But I was forced by economics at my current employer to just keep on hacking. For years I predicted the imminent collapse of our system under the weight of a thousand hacks.

      But it never collapsed. And the functionality and performance has been greatly increased. And we've added five more developers. And we're profitable.

      And because the original design was decent, there have been no catastrophic failures, or impenetrable bugs.

      Sure, we've rewritten many small parts of the system, but in a very iterative fashion. And there are some bits of old (ugly) code pushing four years now that still do their job just fine.

      Maybe this only applies to web development in perl (small CGIs using simple function-oriented modules with SQL to interface to a DB). And maybe it only works for companies using technology as support (as opposed to the company being _about_ technology). But there it works and it works well.

      Maybe here's the deal: we're always doing a "complete rewrite" -- it just takes us a decade and we do it a little bit at a time. But the point I think is that tearing out the guts usually causes more problems than it solves.

      Cheers.

  11. Interesting idea... no data by JohnGrahamCumming · · Score: 5, Insightful

    I'm sympathetic to the idea behind this article, but does it deserve a place on /.? There's absolutely no empirical data, or even a reasonable example given in the document. The author is talking about IPv6 and Perl6 both of which are unknown quantities at this point.

    He's right that just throwing away old code means yo u lose a lot of valuable bug fixes, on the other hand if you look at some code and realize there is a better way then the solution is to rewrite it.

    Of course you can have it both ways. What you do is write an automated test case for every bug that you fix in your code. When you write the new version it has to pass the old test suite, then you've got new code and all the experience from the old code.

    John.

  12. Unix vs GNU/Linux by kps · · Score: 2, Funny

    Ouch! There goes my karma!

  13. Untrue by Shazow · · Score: 2, Insightful

    Although I have an unhealthy habit of wanting to start things from scratch, I believe it can be a good thing more often than not.

    When you've developed a piece of software, fixed its bugs, and tweaked it, more times than not, those fixes and tweaks are nothing more than workarounds for your currently flawed structure. Usually, you don't realize these flaws until AFTER you've created it.

    By starting it from scratch, you can keep your mistakes in mind, and make better and more efficient software.

    Sure, there are chances of running into new bugs, but isn't that what the whole learning process is about? The more you learn, the better the software will keep making. You can only go so far, if you need to turn a paper bag full of feces into an operating system. But if you start from scratch, you can create your own digitized significant other. You know, relatively speaking.

    - shazow

  14. Wow by Boing · · Score: 5, Funny
    That article had about the highest flamebait-to-content ratio I've ever seen on Slashdot (and that's SAYING something).

    This oughtta be good. (puts on asbestos-lined pants)

  15. Rewrites are driven by maintainability by shaka999 · · Score: 4, Insightful

    Your point is well taken about ego often driving rewrites but in my experience the driving force for rewrites is often maintainability.

    As a program ages and drifts from the original intent ugly hacks are often placed on top of the original code to add unforseen functionality. There is also the opposite effect where old code is sitting around that no longer has any function. I remember one drastic case of this when rewriting a program where only about 1/2 the code was even beeing utilized.

    By rewriting the code you clean things up and make it easier for future programers to understand what the code is doing.

    --
    One should not theorize before one has data. -Sherlock Holmes-
  16. Don't Forget To Include Winamp! by mikewren420 · · Score: 4, Interesting

    For Windows users, Winamp is probably the best example I can think of. Take a stable, usable, simple and elegant audio player (Winamp2) and fuck it up by writing it from scratch (Winamp3), then ultimately abandon that clusterfuck rewrite in favor of yet another rewrite (Winamp5) that fixes what they fucked up with Winamp3.

    I'm mighty happy sticking with Winamp2, thank you very much.

  17. ReFactor! by gbr · · Score: 3, Insightful

    Don't rewrite. Refactoring code is the way to go. Refactoring in small pieces allows the app to maintain compatibility as the process progresses.

  18. Maintainability by PhxBlue · · Score: 5, Interesting

    The other side of the rewrite issue is, how long can you continue to maintain code from a legacy system? I worked on a project a couple years ago that had been migrated from assembler to COBOL and is now being rewritten (as opposed to being redesigned) for Oracle. Nevermind for a moment the fact that the customers wanted to turn the Oracle RDBMS into just another flat-file system--which included designing a database that had no enabled foreign key constraints and that was completely emptied each day so that the next day's data could be loaded. . .

    Some of the fields that are now in the Oracle database are bitmapped fields. This is done because there's no documentation for what those fields originally represented in the assembler code and because the designers are afraid of what they might break if they try to drop the fields or attempt to map the fields out into what they might represent. I had the good fortune to get out of the project last August. . . last I checked, they had settled for implementing a Java UI over the COBOL mainframe UI.

    Anyway, my point is this: at some point, you have to decide whether the system you're updating is worth further updates. Can you fix everything that's wrong with the code, or are there some things you'll have to jerry-rig or just shrug your shoulders and give up on? Under circumstances like what I mentioned above, I truly think you're better off taking your licks and designing from scratch, because at least that way you can take advantage of the new features that more recent database software and programming languages have to offer.

    --
    !#@%*)anks for hanging up the phone, dear.
  19. as a programmer's skills increase by polished+look+2 · · Score: 5, Interesting

    As I recall, Torvalds made mention that some of his original code in the Linux base was not very good and he would have written it much differently today. Indeed, most anyone that habitually programs naturally becomes more skilled and if the underlying premisis/framework/model of an application or tool is not as good as could be - or is lacking a certain methodology that time has proven to be beneficial and only rewriting it will solve this - what is wrong with rewriting the code from the ground-up?

    1. Re:as a programmer's skills increase by acidtripp101 · · Score: 2, Interesting

      That is an excelent point.
      I was once working on a time card program for a buisness a few years ago. I was relativly new at programming in the real world (I was still in High School, actually) and after the intital program was 'finished' and we introduced it into the current setup, we had to fix bugs. After fixing bugs, and fixing the bugs that the previous fixes introduced, I realized that if I would have written the program using a different layout, the entire system would just be better.
      I didn't ever completely rewrite the program, but I did slowly migrate the codebase over to the new layout (all in all, I guess I probably rewrote the thing from scratch again... but it didn't seem that way).

      --
      Not Free(as in beer). Free(as in "I'm free to beat you over the head for being a dumbass")
    2. Re:as a programmer's skills increase by jadavis · · Score: 3, Insightful

      what is wrong with rewriting the code from the ground-up?

      Nothing is wrong with that, as long as your time is worth nothing.

      The obvious answer is that if you get some enjoyment out of a rewrite, and you actually do it, then sure, its great. But if you have to trade something more important, than it's bad. What else could you do with your time, and how much enjoyment or productivity would you get out of the alternatives?

      When I first started programming, I would always get a vision about how a piece of software should work, and think about rewriting it. But usually the current software is, to an extent, cluttered for a reason. I think it's only worthwhile if you can actually work out the details, and you're still confident. The details are what always cause the problems.

      --
      Social scientists are inspired by theories; scientists are humbled by facts.
    3. Re:as a programmer's skills increase by Webmonger · · Score: 3, Insightful

      What is wrong with that is that most of the code is correct and solid. It's just organised in the wrong way.

      Instead of rewriting, restructure! When you rewrite, there's a period where the new code doesn't work. If you restructure in suitably-sized steps, the code always works between steps.

  20. Full of shit. by iantri · · Score: 4, Insightful

    This guy is full of shit and has no idea of what he is talking about.

    Some of the better parts:

    - He claims that The mozilla project and everything Netscape >4 is pointless and that Netscape 4 "just works". We all know that Netscape 4 is an awful, crashy, buggy, standards-breaking piece of crap that set the Internet back years.

    - He claims that Windows XP was a complete rewrite. Windows XP is NT 5.1 -- (check with ver if you want) Windows 2000 with the PlaySkool OS look.

    1. Re:Full of shit. by Dark+Lord+Seth · · Score: 4, Funny
      Netscape 4 is an awful, crashy, buggy, standards-breaking piece of crap that set the Internet back years.

      And what does that make IE? The antichrist?

    2. Re:Full of shit. by iantri · · Score: 2, Informative
      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...

    3. Re:Full of shit. by Mysticode · · Score: 2, Informative

      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.

    4. Re:Full of shit. by mcmonkey · · Score: 4, Insightful

      Netscape 4 basically ended the browser wars. That was the point many users switched to IE, and they never switched back.

      Yes, it was that bad.

    5. Re:Full of shit. by Apathetic1 · · Score: 2, Informative

      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.

      --

      My username does not make me Apathetic. It's irony, get it?

  21. Fluff Article by SandSpider · · Score: 4, Insightful

    Okay, so most of the article consists of, "Here's software X. They re-wrote it, and now it's not as good or as accepted. Why'd they do that? They suck."

    Software is re-written for many reasons. Sometimes it's ego, sometimes it's for fun, but usually it's because you take a look at the existing codebase and what you want to do with it in the future, and you decide that it's going to cost a lot less to implement the future features by re-writing and fixing the new bugs than to work around the existing architecture.

    I've had to make the re-write or extend decision more than once, and it's rarely a simple decision.

    What I would have preferred from this article is some interviews with the people responsible for the decision to re-write, and what their thinking was, as well as whether they still agree with that decision or would have done something differently now.

    =Brian

    --
    There is nothing so good that someone, somewhere, will not hate it.
    1. Re:Fluff Article by benja · · Score: 2, Funny

      Okay, so most of the article consists of, "Here's software X. They re-wrote it, and now it's not as good or as accepted. Why'd they do that? They suck."

      Hey, that's exaggerating. The article's more like, "Here's software X. They re-wrote it, and now it's not as good or as accepted. Why'd they do that? I'm not blaming anybody, because I know all this is done by volunteers who do a fantastic job. I'm just saying that the benefits aren't sufficiently obvious to make it overwhelmingly compelling. Bizarre!"

  22. Structural bugs by GrouchoMarx · · Score: 2, Interesting

    Sometimes, rewriting from scratch is necessary to remove bugs. Not all bugs are just failure to check a buffer overflow, which can be fixed without a complete rewrite. Sometimes your basic communications architecture in the program is fundamentally flawed and insecure. At that point, by the time you've fixed that bug in the existing codebase it would have been easier to start from scratch and make everything else work "natively" on the new internal standard.

    Take for example, Windows. ;-) There are fundamental security issues with all GUI windows operating in the same user space. If one is compromised, they're all 0wnz3d. That's a reasonably major flaw, but to fix it would require essentially rewriting the entire GUI portion of Windows, because it's so integral to the system. To try and fix that without a rewrite would be harder and more complicated than chucking it and starting from scratch, and probably introduce a dozen other bugs in the process.

    Sometimes you really do need to throw out the baby with the bath water, if the baby is that dirty. Besides, making a new one can be fun! :-)

    --

    --GrouchoMarx
    Card-carrying member of the EFF, FSF, and ACLU. Are you?

  23. Joel on software article by mitchner · · Score: 5, Informative

    Joel on software has covered this point in a good article: http://www.joelonsoftware.com/articles/fog00000000 69.html.

  24. I didn't read the article by billnapier · · Score: 4, Funny

    It was too messy and unmaintainable. I'll wait until the rewrite comes out to fix all the grammer and spelling bugs.

    1. Re:I didn't read the article by mindriot · · Score: 2, Funny

      Aww... this thread is getting too messy and unmaintainable. You should've done a complete rewrite instead:

      It was too messy and unmaintainable. I'll wait until the rewrite comes out to fix all the grammar and spelling bugs.

  25. rewrite, but do it correctly by tvykruta · · Score: 2, Interesting

    As a video game developer, I've been involved in many "code upgrades", as well as rewrites. As long as the rewrite is being done by people who wrote the original code, and they invest time in some preproduction carefully thinking through what they did right and wrong, the rewritten product will always be faster, more stable, easier to maintain, etc. etc. In the end it's always been a clear winner.

  26. Joel Spolsky by Boing · · Score: 4, Informative
    Joel of Joel on Software 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

    1. Re:Joel Spolsky by chromatic · · Score: 2, Informative

      I kinda prefer JWZ's the CADT Model.

  27. eh, -1 flamebait for the whole article... by SerialHistorian · · Score: 3, Insightful

    Rewrites are 'bad' from a management point of view (at least, a manager that isn't familiar with software development), which looks at return on investment (ROI).

    However, from a developer's point of view, a partial or complete rewrite is sometimes the only way to FIX certain bugs. While it may introduce new, small ones, usually developers are smart enough to read the old code and learn from it's mistakes before the do a rewrite.

    A partial or complete rewrite is ALSO sometimes the only way to fix 'spaghetti code' -- code that's become so tangled from patch upon patch being applied to it that it's now impossible to trace and fix a bug. If spaghetti code isn't pursued and rewritten on a regular basis (this is 'constant improvement' -- a management buzzword from the past few years that actually works), new bugs can be inadvertantly introduced -- and it can sometimes take weeks to hunt down an intermittant bug by tracing spaghetti code. Ladies and gents, WEEKS of programmer time is expensive compared to one programmer spending 8-10 hours per week tracking down bad code in the codebase and rewriting it.

    Really, there's a case for doing rewrites on a constant basis. The author should have instead addressed adequate testing in software development environments...

    --

    --
    Vote for your hopes, not for your fears - Vote Third Party

  28. Rewrites are Good by RichiP · · Score: 2, Insightful

    As a software designer, developer, programmer and user, I have to saw that rewrites done right are A Good Thing(TM). When I do a rewrite, it is with the intention that it is to be better than the old one. I only do rewrites when a limitation of the old code base has been reached or can be foreseen to be reached.

    When a rewrite is to be made, it goes without saying that anything learned from previous development should also be applied to the newer project. If you can't learn from the mistakes of the past, don't do a rewrite.

    It is not rewriting, per se, that is the problem. It is choosing WHEN to do a rewrite. Unless there is sufficient reason to do one (ie. old code hard to maintain, scalability problems, old code reaching its maximum potential, etc.), of course one should stick to improving on existing one. If, however, the reason is that so "we could have something new", or so that "we could say we did a rewrite" or "I'm the new architect around here. Scrap the old code and write my design", then of course rewrites might be more trouble than they're worth.

    All common sense.

  29. Sometimes ya just have to re-write by hcg50a · · Score: 4, Insightful

    From the Perl 6 development webpage:

    "The internals of the version 5 interpreter are so tangled that they hinder maintenance, thwart some new feature efforts, and scare off potential internals hackers. The language as of version 5 has some misfeatures that are a hassle to ongoing maintenance of the interpreter and of programs written in Perl."

    For me, this is a necessary and sufficient condition for rewriting something.

    Another one is: When changing the original will take longer than rewriting from scratch.

    --
    HCG 50a = 2MASX J11170638+5455016
    11h17m06.4s +54d55m02s
  30. I can only say one thing: by Enahs · · Score: 2, Funny

    Enlightenment DR17.

    --
    Stating on Slashdot that I like cheese since 1997.
  31. Rewrite is a good thing by melted · · Score: 4, Insightful

    Every successful piece of software I've ever worked on was rewritten at least once, by the same team (or by myself on private projects) in the process of development, fully or at least partially.

    The fact of the matter is, even if you hire an expensive architect and have him do a good job, he's not a God. When you develop software some parts of it tend to become ugly as heck and you can't help but think on how to do the same thing better and/or with less effort, so that it won't become a PITA to run, maintain, improve and extend. When you reach critical mass, you become "enlightened", throw some shit away and rewrite it to save time later on. In all cases where I've seen it done I think it was worth the extra effort. I also think re-engineering code as you go saves money long-term if it's done reasonably.

    All of this, of course, doesn't apply to those who start their separate standalone projects even though there are dozens of other reasonably good projects to contribute to (and maybe rewrite some parts of). Freshmeat.net is full of examples.

  32. bizzare by cultobill · · Score: 2, Insightful

    While the article is a good rant, it's just wrong sometimes. For instance:

    * He says that IPv6 uses 64 bit addresses. It uses 128 bit in reality. You would think that, if you were saying why something was bad, you'd do some basic research?

    * Also in the IPv6 stuff, "TCP/IP works pretty well". So? TCP/IPv4 and TCP/IPv6 are the same damn thing. That's not an argument against IPv6, it's an argument for knowing what you're talking about.

    * Perl. Sorry, the reasons for moving to the model in Perl 6 is well documented and sane. There's some problems with Perl 5 that we can't get around without losing backwards compatibility (syntax braindamage, for instance).

    * Mozilla. Ok, it's slow. The Mozilla team even admits it at this point. MozFirebird is better. The reason for starting fresh wasn't speed, it was because the old codebase sucked.

    * HTML. Having a language for both layout and data sucks. Splitting it into 2 parts is much better. There are developer perks, too (no rewriting the website to make it look different, no playing with layout to add data).

    The basic point he seems to be missing is: a major version change (1 to 2) is supposed to be a radical update. The version system used by the kernel (and a lot of OSS projects) is based on that. Major.minor.revision. Bump revision when making bug fixes, bump minor when adding features (without breaking too much API), bump major when it's something new altogether.

    --
    -- Bill "Houdini" Weiss
  33. BULLSHIT! by xutopia · · Score: 2, Insightful
    Right now the people that still use Netscape 4 should be hung upside down by their little toes, wipped with a chainsaw and burned with acid dripping on their genitals.

    Netscape 4 is horrible. It's usage is actually slowing down adoption of Mozilla and other far superior browsers. Once we start creating web sites with standards rather than with code that looks like HTML we'll have smaller browsers that can do things much faster than what Mozilla can do today. Indeed Mozilla isn't just one browsers but multiple browsers for all the F'ing crappy implementations of HTML there have been. Just look at the page this article is on. It's ladden with mistakes, isn't even standard HTML 4.0!

    This guy would prefer to see the net stop growing than see some change so he doesn't have to rewrite some stuff. Lazy ass.

  34. rewrites are always a good idea. by Lumpy · · Score: 2, Interesting

    I wrote 3 years ago a web-app based on perl that is currently the heart of one of the tasks my company does. I am in the process of completely rewriting it in php and using no code or concepts from the first iteration in the new release.

    Why? I have better way's of doing things now, I need to be scalable to handle a worldwide company instead of simply a regional tool, and to increase speed, useability and stability.

    a rewrite is the only way to achieve these things. anyone who has been with a project for an extended period of time and had to expand/modify it beyond it's origional capabilities knows this.

    --
    Do not look at laser with remaining good eye.
  35. Firebird by sofakingl · · Score: 2, Insightful

    Don't like Mozilla? Use Mozilla Firebird. Honestly, I can't think of any browser I've used that is better than Firebird (especially with the addition of extensions). Firebird should be enough proof to this guy that Mozilla was a step in the right direction.

  36. aha-time by ]ix[ · · Score: 2, Interesting

    When i coach CS students i sometimes say to them:

    There comes a time in every software development project where the best thing to do is to delete all code and start again, perhaps you are there now?

    But that is usualy when a student has started coding without knowing a squat about how to solve the assignment and realized after a couple of hundred lines of code.

    --
    This is my sig, show me yours
  37. Refactoring + Unit Testing by ggambett · · Score: 2, Interesting

    Ad-hoc fixes to particular problems lead to code bloat. Excessive code bloat leads to a desire to rewrite.

    A full rewrite may have a cleaner architecture, but often, those fixes for particular, tiny problems are lost in the rewrite ("what is this two-line if supposed to do?").

    The solution? Redesign, but get to the new architecture from the old architecture by refactoring, one small step at a time. To do it quickly and with confidence, do unit tests. Lots of unit tests. Ideally, those tiny problems that prompted the fixes should have unit tests specifically built to trigger them.

  38. Rewrite of the article by seanmeister · · Score: 5, Funny

    The Problem: Rewrite Mania
    Waaaaaaa!!

    Case 1: IPv4 vs IPv6
    Waaaaaaa!

    Case 2: Apache 1.x vs Apache 2.x
    Waaaaaaaaaa!

    Case 3: Perl 5.x vs Perl 6
    Waaaaaaaaa! Waaaaaaaaaaa!

    Case 4: Embperl 1.x vs Embperl 2
    Waaaaa!

    Case 5: Netscape 4.x vs Mozilla
    Waaaaaaaaa!

    Case 6: HTML 4 vs XHTML + CSS + XML + XSL + XQuery + XPath + XLink + ...
    XML is hard! My HTML for Dummies book weighs too much! Waaaaaaa!

    Case 7: Windows 2000 vs Windows XP vs Server 2003
    Waaaaaaaa!

    Conclusion: In Defense of "good enough" and simplicity
    Waaaaa waaaaaaaaa!

    1. Re:Rewrite of the article by e-Motion · · Score: 2, Interesting

      The Problem: Rewrite Mania
      Waaaaaaa!!
      ... etc



      Excellent rewrite. I found this post to be much clearer and more concise than the original article, while still maintaining the same message. I'm now convinced that rewrites can be A Good Thing.

  39. Harmful by SEWilco · · Score: 2, Funny

    "Considered Harmful" is Considered Harmful.

  40. An important missed point by rgmoore · · Score: 2, Insightful

    One point that the author seems to miss is that there are better and worse ways of doing a rewrite. Several of the examples he mentions (notably Apache 1 vs 2 and Perl 5 vs 6) are being handled very well. Development on the old versions is continuing while the new versions are being improved essentially in the background. That means that nobody is forced to upgrade until the new version actually provides them with enough tangible benefits that the switch is justified.

    Perl is an especially good example because the new version is actually separating the language specification (Perl6) from the Virtual Machine (Parrot). Parrot will be flexible enough to run both the old and new language specifications, so even people who don't want to rewrite their scripts will benefit from the performance enhancements. Combined with continued development of the existing codebase, this makes Perl very future safe, all while offering the potential benefits of a complete code rewrite.

    --

    There's no point in questioning authority if you aren't going to listen to the answers.

  41. Author ignores some important points by crush · · Score: 2, Interesting
    • Case 1: IPv4 vs IPv6 - IPv4 with NAT presents all sorts of complications and problems when trying to implement IPsec. Not least are the problems of NAT traversal which have only partial solutions available in the form of the NAT-T patches for linux-2.4 and are integrated into linux-2.6 and which can't do AH. Even if this is sorted out then there are still problems with MTU sizes leading to fragmentation as the result of protocol headers being layered within each other. IPv6 avoids these problems.
    • Case 3: Perl 5.x vs Perl 6 - Perl6 development is tied to the fact that the interpreter was hard to maintain due to the structure of Perl5. So, in order to maintain the interpreter and continue to make incremental developments (as the author wishes) it's necessary to clean house. There is also the desire to keep developers (people that can make improvements) involved by allowing interesting new ideas to be incorporated (such as Parrot: a multi-language interpreter)
    • Case 5: Netscape 4.x vs Mozilla - Well, I run mozilla on a 466MHz Celeron with 196Mb RAM and I don't see the speed difference that the author talks about.
    • Case 6: HTML 4 vs XHTML + CSS + XML - There's no question that CSS and XHTML make webpage scripting easier and cleaner. Thank god for these developments. The author makes no substantive argument here
  42. Give and take by j-turkey · · Score: 2, Interesting

    I'm not sure that the author of the story really discusses the give and take of patching an old codebase, vs a complete rewrite. Instead, he focuses on a negative that isn't really there.

    As soon as I read the headline, the first apps that sprang to mind were Sendmail, and WuFTPD. Both have been historically full of holes, and a complete mess. I haven't really looked at Sendmail code, but having to configure each option with regular expressions, while powerful, is just lame (IMO). The WuFTPD code is a mess. It's been passed on and passed on, and patched and patched. It eventually became a total whore that nobody really wanted to touch on any level.

    Now, both of these (AFAIK) were not rewritten from scratch, and suitable replacements have been produced all over the place. However, would it have been so bad to rewrite those from scratch, while still maintaining the older versions? How would it be any different from, say, the Linux kernel. I run 2.4.x on my production machines. 2.6 is out, but I'm not going to run it until it's proven itself elsewhere (and is integrated into a mainstream distribution). 2.4 will be maintained for a long, long time -- and it's not eve na complete rewrite (AFAIK). Usually code rewrites are adopted by the public...not right away, but eventually.

    Finally, his gripe about Mozilla/Netscape are interresting, but not really warranted (and he does acknowledge this). The applications became more bloated as system resources became more plentiful. Software tends to do this -- it has to do with greater layers of abstraction as hardware gets better. But furthermore, it's because Mozilla had to be able to "compete" with the latest greatest from Microsoft...which MSFT will always be updating as new standards are added.

    The point is, it doesn't really matter. It doesn't do a disservice one way or the other, and since much of the software we're talking about is Free Software, it matters even less, since the code it out there -- if there are enough people using the older versions, there will always be someone to maintain it.

    --

    -Turkey

  43. Re:How did this troll get to main page? by NeuroManson · · Score: 2, Informative

    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.

    --
    Just because you can mod me down, doesn't mean you're right. Shoes for industry!
  44. Is the submitter fucking nuts? Or on crack? by squarooticus · · Score: 2, Insightful

    Exactly when did Netscape ever work well on Linux?

    All I remember is consistent crashing from Netscape Gold through the finally-put-down Netscape 4.x. It was the biggest piece of shit browser ever written precisely because its codebase was old (forked from NCSA Mosaic in 1994, which itself was much older) and non-extensible, yet more and more shit was thrust into it. It had to be rewritten, and all the Gecko-based browsers have been much more feature-complete and reliable for the past 2-3 years than Netscape ever was.

    I use Galeon, and the thing basically never crashes. Back in 1999, I considered myself lucky if a particular version of Netscape 4.x only crashed once every half-hour.

    --
    [ home ]
  45. Maintenance programming can be done well by lildogie · · Score: 2, Interesting

    Maybe times have changed, but when I started my career as a _maintenance_ coder, there were two ways to do it:

    1) The usual way: fix small sections of code in the same style and technique that it was originally written,

    2) rewrite large sections of code that were _truly_ hard to maintain, taking great care to leave something much more maintainable behind. This route requires much more thorough testing than (1).

    I remember another of us "programmers" who said he didn't do maintenance, he was a "development animal." Wrote abysmal code. When he rewrote a major module of our system he tried to make FORTRAN look like ALGOL, using GOTO statements in the righthand margin of the code.

    I bet that module got a rewrite not long after that. Something that was maintainable and written for the language that was being compiled, not the language that didn't even exist on our system.

  46. Code Rewrite -- Rational Reasons For It by wwvuillemot · · Score: 2, Insightful

    I do not concur with the author's seemingly blanket assumption that a complete re-write of codebase is wasteful. There are times when it is necessary for both practical and philosophical reasons.

    From the practical standpoint, and suggested by other astute readers, often times the initial specs did not sufficiently anticipate future growth. Needless, it is a poor programmer who does not from a programmatic perspective anticipate this and do his/her/its best to provide a sufficiently robust framework that has at least one order of magnitude growth in a primary spec. On top of this, standards change, new ones emerge, "paradigms" shift, needs change and so on -- at times it just makes sense to start from scratch. You are not going to build a business building on top of your house's foundation...it just is not scalable to the new needs.

    Philosophically, I think it is worth tearing down the structures and building anew at times. Too much incremental growth can lead to long term stagnation as the original skills to build the foundation are lost through inactivity. As an aerospace engineer I can see it now where too much information and processes have become institutionalized -- I fear if ever we needed to do it from scratch.

    1. Re:Code Rewrite -- Rational Reasons For It by chromatic · · Score: 2, Insightful
      You are not going to build a business building on top of your house's foundation...it just is not scalable to the new needs.

      That may not be a good analogy. You can't gradually update your house's foundation, while you can gradually improve the foundation of a piece of software.

  47. What about Gnome? by Anonymous Coward · · Score: 3, Insightful

    The Gnome desktop environment is a prime example of disasters through re-writes.

    As we all know, Gnome's oringal purpose was to provide a free rival to KDE, which was the first easy to use Desktop Environment for Linux, this was back before Qt was GPL

    Unfortunaltey for Gnome, its problems started as it kept replacing and rewriting core components. For example, it started out with the Enlightenment window manger, then it switched to sawfish, then it switched to the buggy and slow metacity. Metacity has had many problems, and most people want the old sawfish back, but havoc pennington refused to do it and insists that people use it.

    The file manager keeps changing too. First it was GMC, then it was the Slow and buggy Nautilus from the now defunct Eazel corporation, now they are writing a new Windows 95 like file manager for gnome called Spiral Nautilus.

    It also rewrote the graphics layer GTK and broke compatibillity with GTK 1.x. There are many legacy GTK apps still in wide use and they look ugly on newer desktops.
    There is also the many problems with the file dialog, which is now only emerging in GTK 2.4. This is also incompatible with older GTK versions. This means that if you want to use a new program, YOU HAVE to upgrade to Gnome 2.6, and can't keep your leagcy Gnome 2.0,2,4 desktops.

    They keep switching default apps, for example, Galeon was dropped in favour of the buggy and far less featureful Epiphany in 2.0. They also dumped several other applications that were useful.

    To make matters worse, it is going away from the old philosphy of simple text files and are using an XML based registry clone to configure stuff. KDE keeps the text file format underneeth and has had a standardized API for it.

    It also has a lack of true intergration, Micheal de Incanta has PUBLICLY ADMITTED that Bonobo was a faliure. KDE has had this BUILT in from day one using kpart technology, which is now being used in Apples Mac OS X Panther Edition.

    Gnome developers, realising they kan't kompete with KDE technology, has spread various FUD about kde, but the message is getting through. Red Hat has abondaned their Gnome desktops, Fedora developers are working hard to make KDE 3.2 the default desktop for Core 2. Debian, who has traditionally been pro-gnome have announced their full support for KDE and they are working hard to make KDE the defualt desktop for

    KDE on the other hand has kept consistent technology and has internally has changed very little since 2.0. Distros like Lycoris are still using 2.x because it is very stable and mature. KDE 3.2 will be a good example of why maturity, and not wheel inventing is a better idea overall. They have took their technology and have optimized it for usabillity

    Gnome 2.6 will need more than just propoganda about the HIG if it is going to get the attention it needs, but instead it looks like they are reinventing wheels again.

  48. Re:speaking of IPv6 vs IPv4 by Mod+Me+God · · Score: 2, Interesting

    I'm not sure of the relative validity of these points... though I agree with the sentiment.

    1. This is a Cisco problem, a general problem is in the points below:
    2. I didn't know there were "16.7 million addresses per square metre of the earth's surface, including the oceans", interesting. The problem with the present system is the 'chunking' of IP addresses... large groups of IP numbers lay dormant, reserved for academic/government institutions, the portion of private addresses is being squeezed in places. The IPv4 problem is an allocation problem, but allocations are determined by committees, and as soon as disparate and opposed committees get going progress and action stop for years, yes it is annoying beaucracy, but a technical work-around may well be easier than fighting this pettyness.
    3. A few years ago the internet was here and it did its job while processing power of out-of-the-factory internet infrastructure was so much lower than it is today. Volumes are higher now, the dotcom boom of endless financing has gone (maybe?!) but I believe the internet with IPv6 and its higher volumes could be cheaper now than it was (I am happy to have my mind changed with hard data but not supposition and not opinion based on loose facts and assumed weightings). Lecacy equipment and software has to be replaced sometime, all that COBOL was re-written pre-2K pretty easily.
    4. See 3.

    There may be "16.7 million addresses per square metre of the earth's surface" but if this can provide a solution for the next few decades, and is easier to overcome than the present beaucracy in IPv4 allocation (which is huge and incredibly difficult to overcome IMHO) then it is worth it.

    --
    --

    FreeNET user? Comfortable with the adverse selection?
  49. A similar article... by slamb · · Score: 2, Interesting

    Here's a much better article with a similar thesis: Joel on Software - Things You Should Never Do, Part I

    There are parts of it that I've never agreed with:

    "Well," they say, "look at this function. It is two pages long! None of this stuff belongs in there! I don't know what half of these API calls are for."

    [...]

    Back to that two page function. Yes, I know, it's just a simple function to display a window, but it has grown little hairs and stuff on it and nobody knows why. Well, I'll tell you why: those are bug fixes. One of them fixes that bug that Nancy had when she tried to install the thing on a computer that didn't have Internet Explorer. Another one fixes that bug that occurs in low memory conditions. Another one fixes that bug that occurred when the file is on a floppy disk and the user yanks out the disk in the middle. That LoadLibrary call is ugly but it makes the code work on old versions of Windows 95.

    This should never happen! If you have all these bugfixes in your code and no way to know why they were put in, you've screwed up badly. You should have each one documented in:

    • a bug number in the database
    • a log message in your commit history (cross-referenced to the bug database) (which you should be able to pull up easily with "cvs annotate" or similar)
    • if it's particularly weird-looking, a comment in the code

    So the idea that you'd have all these important bugfixes without any way of knowing what they are should be laughable! Given a codebase like that, you probably would be better off throwing it out, because it was clearly developed without any kind of discipline.

    Also, he's embelleshing a lot. If it's just a "a simple routine to display a window", it doesn't need to load a library, require Internet Explorer, etc., and thus can't possibly have bugs related to those things. He makes the situation sound a lot more extreme than it really is.

    But in general, I think he's right. Refactor, not rewrite. That's the same thing the XP people say to do. They also have extension unit tests to make it easier to refactor with the confidence that you haven't screwed anything up. Which can help in situations like this:

    I laughed heartily as I got questions from one of my former employees about FTP code the he was rewriting. It had taken 3 years of tuning to get code that could read the 60 different types of FTP servers, those 5000 lines of code may have looked ugly, but at least they worked.

    Ugh. I bet it would have been a lot less tuning if there were a decent way to test that the change to support #60 hasn't broken any of the previous 59 server types. Or that just a refactoring hasn't broken any.

    I don't think this advice always applies, though. I rewrite one major project from scratch at work: our personnel system. Our database schema was hopelessly denormalized and broken. That's not something you can refactor easily - with a widely-used database schema, it's easy to make one big change than many smaller ones, because a lot of the work is just hunting down all the places that use it. That's easier to do once. So I believe there are situations this advice does not apply, but I also believe they are rare.

  50. Hard to write code that doesn't need rewrites by astrashe · · Score: 4, Interesting

    It's hard to write code that is robust enough to not need rewrites. The ability to do that is what separates the really good programmers from amateurs like myself. It's the difference between being a piker (like myself) and an engineer.

    I'm not a great programmer, and don't do it regularly, but when I have written fairly big projects, I find that the need for rewrites came out of poor design choices that I had made.

    I typically start out with something small, that can handle the core functionality expected from the project. Then I try to add features and fix bugs.

    Eventually, the code becomes very difficult to maintain, and ultimately, you get to the point where the ad-hoc architecture simply won't support a new feature.

    To the user, everything looks fine, everything runs reliably, but under the hood, there are real problems.

    My worst experience was with a web app. I started out with script based pages in ASP (not my call), and kept writing new pages to do different things. It got to the point where I had a about three hundred script pages and lots of redundant code.

    When it would become necessary to change the db table structures for another app hitting the same data, I'd have a lot of trouble keeping up, fixing my code quickly in a reliable way.

    The problem was that it just wasn't possible to stand still. I couldn't go to my boss and say, "I need a three month feature freeze, to rewrite this stuff."

    Writing a new version in parallel was hard because maintaining the crummy but functional code was taking more and more time. It was a real problem, and caused me a fair amount of pain, and suffering.

    After digging myself into that hole, I stepped back and tried to figure out how other people did it. I would have been a lot better off building on top of something like struts.

    The lesson I took from this is that it's important to study design patterns, and to use tested frameworks whenever possible. You have to think like an engineer, and not someone who codes by the seat of his pants. I'm not an engineer, so it's not easy for me to do that.

    I'm not saying that the people who run the projects mentioned are in the same boat that I was. As programmers, they're in a different league.

    But they're often working on problems that aren't well understood. Patterns and frameworks are ways to leverage other people's experiences. But if that experience doesn't exist, you have to guess on certain design decisions, and see how it comes out.

    Top notch programmers are obviously going to guess a lot better than someone like me will. But they're still going to make mistakes. When enough of those mistakes pile up, you're going to need to do a rewrite.

    You could make a point that's opposite of the one that the article makes by looking at the java libraries.

    They made choices with their original AWT gui tools that were just wrong. They weren't dumb people -- they just didn't know, the experience necessary to make the right choice simply didn't exist. Once they tried it, they realized it wasn't working, and they came back with Swing.

    Rewrites are always going to be necessary for new sorts of projects, because you can't just sit in your armchair and predict how complex systems will work in the real world. You have to build them and see what happens.

  51. There's room for middle ground by Waffle+Iron · · Score: 2, Interesting
    When I feel that a program is in need of a structural overhaul, I don't just throw it away. I usually comment out all of the source code, back down to a blank 'main()' function. Then I build it back up piece by piece using a cleaner design. However, instead of writing a lot of new code, I uncomment and tweak the bits of the commented out old program that worked fine. I usually find that huge swaths of the original program needed little or any work to adapt to the new architecture.

    Once all of the old code has been either pasted back in, revised or deleted, I've usually got a program that does everything the old one does and more, but it is smaller, simpler and cleaner.

    Most of the subtle features and knowledge embedded in the old code is not lost by using this approach; it gets pulled back in.

  52. You Whippersnappers with Your XHTML by ortcutt · · Score: 2, Funny
    This is my summary of the content of this article:
    Back in my day, when we got home from a hard day of making hoopskirts, we were happy enough to use our K6-II 450's to read plain old HTML 4.0.1 and maybe serve some web pages with Apache 1.3 like my granpappy used to do. Now the kids these days, they got their Althon64 and use Mozilla to read XHTML and probably use IMAP to a remote mail store. Won't those kids ever learn that the world was perfect in 1995 and that no improvement can be made on it except maybe by continually patching the same tools and standards that we already have.
  53. Rewrites by JASegler · · Score: 2, Insightful

    There comes a time in any softwares life that a rewrite IS the correct decision.

    To put it in real world terms...

    If you take a single floor home and start adding floors to it, you won't ever turn it into a skyscraper. At least not one I'd ever want to be near.

    If you want a skyscraper, you bull doze the house, design the skyscraper and build it.

    A lot of early design decisions can really haunt you later. Like the Apache threading example in the article.

    -Jerry

  54. Fight of the Century... not by ReadParse · · Score: 2, Funny

    The story says, in part...

    "Examples include IPv4 vs IPv6, Apache, Perl, Embperl, Netscape/Mozilla, HTML and Windows"

    All props to IPv4 and all, but I don't think it stands a chance against all of those put together (even with Windows on their team).

    RP

  55. my experience with J2EE rewrite from CGI by SpecialAgentXXX · · Score: 2, Interesting

    In the company that I work for, we have been running our CGI "legacy" financial application for the past 8 years. After the first 4 years, it worked fine with no more problems! Scalability, memory leaks, etc., etc. were all found. The application just hums along doing its job and the users are happy.

    But 4 years ago management had to jump on the J2EE bandwagon and introduce the "Java" version of our financial product. Here it is FOUR years later and our "new" Java app is still not in production because of spec changes, clustering issues, etc., etc., etc.

    I kept telling them K.I.S.S., but sales said that we need the new buzzwords to get clients and everyone knows about "Java". Hell, the way I see it, every time management changes their mind, it just adds to my job security since we need to make more changes.

  56. Good vs Bad rewrites by Anonymous Coward · · Score: 2, Insightful

    Rewrites can be good or bad depending on the goal and the understanding of the people doing them.
    For a good rewrite to occur the following need to be true:
    - emphasis on smaller/simpler code, NOT adding new features (new features may come about "for free" as part of the new design, but must not be added in as extras at this stage)
    - the person/team doing the work should have a full understanding of the whole architecture of what is being rewritten
    - full access to all the previous bugs and bugfixes to make sure the new versions addresses all these problems
    - fairly complete regression testing should be available to compare the old and new versions
    - reduce/simplify/refactor as much as possible; identify common patterns and eliminate the redundancy, and in so doing hopefully eliminate bugs as well

    It's a pretty major chore that requires a lot of understanding and very comptenent people to head up the effort. But if done right, it's well worth the effort, because if it can maintain compatibility (or at least mostly) and greatly simplifies the source base, it will dramatically decrease the maintenance time needed in the future, and can naturally wipe out many potential bugs at the same time, reducing future debugging time.

  57. Lousy Examples by avdi · · Score: 3, Insightful

    Most of the examples given needed rewrites to remain viable. It's easy to look at a package from afar and declare it "perfectly sufficient". Things look different when you have to work with a system daily. In particular, rewrites often address shortcomings in a system's capacity for extension. Just compare the number of third-party extensions available for Netscape 4.* vs. the number now available at mozdev.org for Mozilla and Firebird.

    A bigger problem, to my mind, is when a half-dozen projects with the noble intention of replacing an aging kludged-up tool are started, all of which suck in different ways, and none of which learn from each other. And then they lose momentum and stagnate.

    Examples? Most programmers agree that "make" is overdue for replacement, but despite many attampts (cmake, jam, cons, ant) no one has managed to come up with one that is compelling enough to catch on. CVS is a crufty mess, but none of it's potential replacements are mature enough or have the kind of widespread tool support to make much of a dent in CVS installations. And there are dozens of written-from-scratch applications which differ primarily on the GUI toolkit they are based on, which would be better apps if they incorporated the best features from all into a joint effort. My idea of the perfect browser combines features of Konqueror, Galeon, Epiphany, Firebird, and Safari.

    --

    --
    CPAN rules. - Guido van Rossum
  58. This is bogus... by clifgriffin · · Score: 2, Insightful

    There are always ways to improve code. Much of the time you'll end up with a much smaller, much more efficient, much more extensible application.

    Rewriting is almost always a good thing. The rules of writing english papers apply here.

    At a certain point, certain portions will mature to the point that they can't or needn't be improved with each successive version. If you're content with the architecture, you'll reach this stage. But not many applications can evolve to new heights with the same diagram/layout it started with 5 years ago.

    This is just a poor attempt to get noticed.

  59. Throw one away by cdunworth · · Score: 3, Insightful

    It's really common to build something, step back, examine its warts, and start over again with a new perspective and understanding. It's called prototyping. Some people actually build the first one with the intent of throwing it away. Others release it as v1.0, and introduce issues of the kind this author is referring to.

    There are many reasons you might prefer a rewrite. The main one, to me, is that complicated applications contain layers and dependencies, not all of which are obvious to a new programmer. If, after some analysis, your assumptions about these dependencies are wrong, you'll break the original code faster than you can say "global variable". In the end, you could easily spend more time and effort patching and praying than you would rebuilding from the ground up.

    Of course, if some of the original architects are still involved in the project, arhictectural knowledge and assumptions can be transferred to new programmers in a fairly fluid way, and I suspect it is in these cases where you can confidently add on to an existing code base.

    And it's always helpful if the previous programmers were actually good programmers, and who wrote code and comments that were mindful of those who might follow them later. But that's not within your control.

  60. Icarus Verilog rewrite by stevew · · Score: 2, Informative

    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!

    --
    Have you compiled your kernel today??
  61. Perl 6 v Perl 5 by Yrd · · Score: 3, Informative

    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?

    --
    Miri it is whil Linux ilast...
    1. Re:Perl 6 v Perl 5 by soulsteal · · Score: 2, Funny

      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.

      Sort of how tea is a substance almost, but not completely, not unlike tea.

  62. other areas of engineering by bigpat · · Score: 2, Insightful

    seems common in other areas of engineering also, bridges could just be retrofitted, buildings added on to, but sometimes there are too many unknowns in engineering old structures... Are the building materials made from Asbestos, How has the structure held up after so many years? Have other modifications extended or complicated further modifications beyond that which the original plans called for? Sometimes the unknowns themselves justify building from scratch. Sure we could just keep tacking on new technologies to old, but the result will seldom be better. More often the real advancement comes from taking the knowledge gained from past experiences and applying them to new, rather than actually taking old work and trying to make it work in a new situation.

    Would you really want horses running on a treadmill attached to the front of your car, just because humanity wouldn't want to throw away its previous investment in transportation technology?

  63. Professionally written... by mypalmike · · Score: 2, Funny

    Well, it was professionally written, except for the use of phrases and words like "pain in the ass", "jackass", and "asshole".

    --
    There are 0x40000000 types of people: those who understand 32-bit IEEE 754 floating point, and those who don't.
  64. Why do I rewrite things? by pclminion · · Score: 2, Insightful
    I find myself constantly rewriting any code that I have complete control over. Code I write for my employer evolves continuously, but personal code for my own enjoyment is constantly getting axed and redone.

    Having done this for years, I think I'm starting to figure out why I do it, and perhaps someday I'll be able to stop myself from doing it, so that I can actually release something :-)

    I think the need to rewrite is more emotional than intellectual. As I work on an existing codebase, I notice the little bumps and warts on it, the little "tweaks and fixes" which make it work, and I find them ugly. For some reason, I place the highest aesthetic value on code that was written in one big, flowing session, where the entire structure was understood from the beginning, and the entire thing looks like it was born fully-formed from some supernatural source.

    In an ever futile attempt to realize this goal, I constantly chuck out perfectly good code and redo it from scratch. I do this because I seek the emotional experience of those few times when I really do sit down and blast out something that's beautiful, elegant, and functional. Even if, practically, it's no better than before.

    Open source programming is often described as scratching an itch. It should be immediately apparent why this correlates to extensive rewriting of code. Some problems are simply enjoyable to solve. The necessary thinking feels good. Just as we watch a good movie again and again even though we've got the plot memorized, some programmers want to rewrite the same functionality repeatedly because it just feels good.

    To hell with practical considerations, like whether or not that's "bad" for the codebase. I program for pleasure.

  65. Sorry bud by Kombat · · Score: 2, Informative

    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.

    --
    Like woodworking? Build your own picture frames.
  66. Mozilla rewrite was necessary by Anonymous Coward · · Score: 2, Insightful

    > But you have to consider what Netscape would be like if it had had the amount of work put into it that mozilla has now.

    If you knew the history of the Mozilla project, you would know that modifiying the old Netscape code would have gone nowhere.

    Before the Mozilla developers decided that a rewrite was necessary, they spent the better part of a year trying to improve the original Netscape code.

    But the code was so bad that they couldn't attract any developers -- no one was willing to work on it.

    Trying to work on the old code was boring, and difficult, and required huge amounts of effort for very little gain. Also, the code was not modularized properly, which meant that very few developers could work on it at the same time without constantly tripping over each other.

    If they had simply tried to upgrade the old code, you would have a slightly better Netscape browser today (assuming they didn't give up entirely).

    But the rewrite attracted large numbers of developers, and produced some real innovations.

    Today, Mozilla is a much better browser -- head and shoulders above IE -- with better stability, better standards support, and features such as tabbed browsing, and pop-up blocking.

    But more than that, the Mozilla project has given us a powerful cross-platform development toolkit, with the XUL user-interface facility. This has not only created a new field in developing Mozilla plug-ins, but is being used for the construction of many other products.

    The original poster was right. The author of the article is talking nonsense.

  67. MS IE? by Razzak · · Score: 2, Interesting

    I seem to remember the person in charge of developing Internet Explorer for MS saying this *exact* same thing. In fact, he claimed this was the reason MS won the browser war: Netscape lost all their years of work because they decided to re-write their browser, while IE tweaked theirs. I'm sure I read this on /. somewhere, but I can't find the article.

    I know a lot of it had to do with MS's business tactics, but Netscape/AOL took like 5 years to put out a new browser after 4.7. And do you guys even remember Netscape 6 Preview? What a god-awful browser that was. My friends starting calling it Nutscrape cuz it was so painful to use :(

  68. Re:Damned if you do, damned if you dont. by CmdrTHAC0 · · Score: 2, Insightful

    Those instances of Slashdotter are not necessarily the same person. Furthermore, Microsoft would be totally braindead to make a business plan from Slashdot comments. BillG probably isn't that dumb, despite what we wish for ;-)

    --
    __CmdrTHAC0__
    In Soviet Russia, Spanish Inquisition doesn't expect YOU!!
  69. It _can_ be faster... by Ayanami+Rei · · Score: 2, Interesting

    If all you're browsing are pages served from a single domain, consisting primarily of flowed elements (headers, lists, images, and that's about it) with pages that are fairly short.

    Start adding tables and forms, trying to reflow the page when resizing (especially if it's a long one), and prepare for the wait of your lifetime.

    At least mozilla can display part of a page while the rest renders, and resolve more than one domain name at a time when connecting to resources in parallel.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  70. As long as you don't make this mistake... by devphil · · Score: 2, Interesting
    what is wrong with rewriting the code from the ground-up?

    I usually find Jamie Zawinski to be an arrogant rude asshole, but occasionally our opinions overlap. In this brief rant he describes the Cascade of Attention-Deficit Teenagers software development model, which often leads to rewriting code from the ground up. Over and over and over.

    Stay out of that trap, and actually fix stuff during your rewrite, and there's nothing at all wrong with doing it over from scratch. Rewrite it just because you don't feel that modifying other people's code is sexy enough, or that your version will surely be bug-free -- because, hey, it's you -- or because "you would have done things differently," and you'll have failed.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  71. Opera 3,5,6,7 by danila · · Score: 2, Informative

    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).

    --
    Future Wiki -- If you don't think about the future, you cannot have one.
  72. How about GNU? by ivoras · · Score: 2, Informative
    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 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!
    --
    -- Sig down
  73. A response in the defence of XHTML by Trejkaz · · Score: 2, Insightful

    I sent this reply to the author through the site, but it would probably get some use here too.

    "The Web was based on the idea that a simple markup language could allow us to divorce document presentation from document structure"

    Which HTML 1.0 through 3.2 didn't really achieve, admittedly...

    "Some of the changes to HTML were done in a way that shouldn't break old browsers, but as I said before, I am increasingly seeing websites that don't render properly in Netscape 4.x"

    There's a shock. I thought it was 2004, and you're still testing on a browser which is at least three major revisions old, never mind that Mozilla itself seems to be more useful than Netscape's rebadged browser.

    "So apparently the FONT tag is deprecated - now we have to use style sheets and whatnot to do something that was originally very simple"

    This is because "the web was based on the idea that a simple markup language could allow us to divorce document presentation from document structure", and the FONT tag is presentation appearing in the document structure. That's sort of like a divorce where the couple still sleep with each other.

    "but at the expense of being able to do simple things quickly."

    I beg to differ. Even if I really want to break style guidelines and make a chunk of text red for no particular purpose, it still takes the same amount of time to type <span class="red"> than it was to type <font color="red">. Never mind that this really is a bad thing to do. Why is it red? Is there a meaning to the red? Perhaps it should be <span class="important">, in which case why not just use <strong>?

    "As a Web developer I have long wondered why they didn't add more types to the INPUT form tags to express different types - for example, a DATE attribute, or INTEGER, DOUBLE, or whatever."

    Of course XHTML 2.0 will be partnered with XForms, which will attain this functionality in so as far as any field which can store a value can be of an XML Schema type. This includes -- wait for it -- dates, integers, doubles, and arbitrary regular expressions.

    "These "rich" (but simple! not XML!) attributes could then be seen by the browser and presented to the user in whatever way is supported by the system"

    Hopefully they do this. I would love to see browsers implement a calendar popup. I can't count the number of times we had to use a JavaScript for this.

    "But the direction we're going in, the HTML books have just become thicker and thicker over the last few years."

    This I don't get. There are less tags now, right? It's the CSS and XSL books which should be getting thicker. By the way, never buy a book on XSL:FO. I accidentally dropped that on my foot, and christ, they hurt.

    I think the progression from HTML 4.0 through XHTML 1.0 to XHTML 1.1 was smooth. They're encouraging people to go back to the roots of the web: to mark up content depending on what it means, not depending on how it's supposed to look. Sites like www.csszengarden.com are living proof of how the separation of HTML and CSS can achieve excellent separation of concerns between the graphic designer and the web developer, and I'd personally love to see more sites such as this (only with real content!) pop up all over the place. If for no other reason than the pages loading faster due to many, many less tags in the HTML! :-)

    --
    Karma: It's all a bunch of tree-huggin' hippy crap!
  74. Large and small projects by CreateWindowEx · · Score: 2, Insightful
    I think this discussion is being clouded because people have experience with different-sized projects. If you are working on some fairly small tool which has a well-defined usage, it may be reasonable to rewrite the whole thing from scratch, partly because it is possible to test it fairly thoroughly yourself to verify your new version, and because it is possible to understand the whole thing in your head at one time, and thus make the decision to rewrite rationally.

    However, if you're talking about a larger project such as a commercial software application with 50 man-years of development, a complete rewrite will usually be undertaken with a large degree of ignorance of the true problem domain. Also, you can rewrite your codebase to fit more nicely with the *current* state of your specs and requirements, but the new "elegent" design may be even less suitable to tomorrow's new feature request. Even rewriting a major subsystem from scratch can be a costly mistake.

    The real trick is how to maintain the code in such a way that it continuously improves instead of just getting more and more riddled with spaghetti, dead code paths, and other clutter. It's especially hard, because it's easy to forget to treat a mature code base with respect, and just hack in "one more" thing because you are hoping to rewrite it at some point.

    There is the "broken window" idea--one broken window will lead to an increasing spiral of vandalism, and one line of crud in a source file will give future programmers the feeling that they can add ten more lines of crud because the code is already "dirty". While the usual adage is to clean up the window immediately, the reality is that most source files have one hundred broken windows already and fixing them all right now is not an option. What takes discipline is to make sure to leave each file in a better condition than you left it--remove some dead code, do a little refactoring to clean it up, rename identifiers or reformat code to conform with project-wide standards (NOT your personal pet style!!! This is very annoying when people check out a file, reformat it to their own preference, add one small feature, break some other part of the code, and check it back in to source control...). Another common problem is when people come up with some "new religion", convert about half the code over to the new way, but leaving it in a "worst of both worlds" state because it turns out the "new way" was just "different" and added as many problems as it solved. It is easy to add code that goes against the grain of the existing code because you didn't bother to really understand the system and structure of the code, or because you don't "like" a certain design decision.

    In many ways, the real achievement is that higher mental state where you stare at the huge, messy codebase that you've been working with for ages, have the "aha" moment, come up with a simple refactoring, make changes to fifty files, replace hundreds of lines of code with tens of lines, and it just works the first time and only takes a few hours, because for one fleeting instant, you had the whole thing in your head at once. I wish I could have more of those moments.

    I'm as guilty as any for violating these ideas--I often keep my nice clean "new" subsystems tidy because they are already tidy and conform to my current design philosophies/religion, but let my big, mature--and often more imporant--subsystems grow increasingly crudified because I have the continuing fantasy that I will be rewriting them from scratch "next project"...