Make Historic Transom Windows Work Again - Nailed Shut
Netscape 6.0 is finally going into its commencement public beta. At that place never was a version 5.0. The last major release, version 4.0, was released almost 3 years ago. Three years is an awfully long fourth dimension in the Net world. During this fourth dimension, Netscape sat past, helplessly, every bit their market place share plummeted.
It's a bit smarmy of me to criticize them for waiting then long between releases. They didn't do it on purpose, at present, did they?
Well, yes. They did. They did information technology by making the single worst strategic mistake that whatsoever software company tin can make:
They decided to rewrite the lawmaking from scratch.
Netscape wasn't the first company to make this fault. Borland made the same mistake when they bought Arago and tried to arrive into dBase for Windows, a doomed projection that took so long that Microsoft Admission ate their lunch, then they made it once more in rewriting Quattro Pro from scratch and astonishing people with how few features information technology had. Microsoft almost made the same mistake, trying to rewrite Word for Windows from scratch in a doomed project chosen Pyramid which was shut downwardly, thrown away, and swept under the carpeting. Lucky for Microsoft, they had never stopped working on the old code base of operations, so they had something to ship, making it merely a financial disaster, not a strategic one.
Nosotros're programmers. Programmers are, in their hearts, architects, and the commencement thing they desire to do when they get to a site is to drive the identify apartment and build something grand. We're non excited by incremental renovation: tinkering, improving, planting flower beds.
There's a subtle reason that programmers e'er want to throw away the code and get-go over. The reason is that they retrieve the old code is a mess. And hither is the interesting ascertainment: they are probably incorrect. The reason that they think the former code is a mess is considering of a key, key law of programming:
It'southward harder to read code than to write it.
This is why lawmaking reuse is so hard. This is why everybody on your team has a unlike function they like to use for splitting strings into arrays of strings. They write their ain part because it's easier and more fun than figuring out how the old role works.
As a corollary of this axiom, you can ask about any developer today almost the code they are working on. "Information technology'due south a big hairy mess," they will tell you. "I'd like zippo amend than to throw it out and start over."
Why is it a mess?
"Well," they say, "look at this function. It is two pages long! None of this stuff belongs in there! I don't know what one-half of these API calls are for."
Before Borland's new spreadsheet for Windows shipped, Philippe Kahn, the colorful founder of Borland, was quoted a lot in the printing bragging about how Quattro Pro would exist much amend than Microsoft Excel, because it was written from scratch. All new source lawmaking! As if source code rusted.
The idea that new code is better than old is patently absurd. Old lawmaking has been used. It has been tested. Lots of bugs take been found, and they've been fixed. There's nothing incorrect with it. It doesn't acquire bugs only by sitting effectually on your hard bulldoze. Au contraire, babe! Is software supposed to be like an old Dodge Sprint, that rusts only sitting in the garage? Is software like a teddy acquit that's kind of gross if information technology's non made out of all new cloth?
Back to that two page role. Yep, I know, information technology's just a elementary function to display a window, simply it has grown little hairs and stuff on it and nobody knows why. Well, I'll tell you why: those are problems fixes. One of them fixes that bug that Nancy had when she tried to install the affair on a reckoner that didn't accept Internet Explorer. Another i fixes that bug that occurs in low memory weather. Another i 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 only it makes the code work on old versions of Windows 95.
Each of these bugs took weeks of real-world usage earlier they were plant. The programmer might take spent a couple of days reproducing the bug in the lab and fixing it. If it's like a lot of bugs, the set up might be 1 line of code, or it might even exist a couple of characters, but a lot of work and time went into those two characters.
When y'all throw away code and offset from scratch, you are throwing away all that knowledge. All those nerveless bug fixes. Years of programming work.
Yous are throwing abroad your marketplace leadership. You are giving a gift of two or three years to your competitors, and believe me, that is a long fourth dimension in software years.
You are putting yourself in an extremely dangerous position where you lot will be aircraft an old version of the code for several years, completely unable to make whatever strategic changes or react to new features that the market demands, because you don't have shippable lawmaking. Yous might likewise just close for concern for the duration.
Yous are wasting an outlandish amount of money writing code that already exists.
Is in that location an alternative? The consensus seems to be that the sometime Netscape code base of operations was really bad. Well, information technology might have been bad, but, you know what? Information technology worked pretty darn well on an awful lot of real world computer systems.
When programmers say that their code is a holy mess (as they always exercise), there are three kinds of things that are wrong with it.
First, there are architectural problems. The code is not factored correctly. The networking code is popping up its ain dialog boxes from the middle of nowhere; this should have been handled in the UI code. These bug can be solved, one at a time, by carefully moving code, refactoring, changing interfaces. They can be washed by 1 programmer working carefully and checking in his changes all at once, and then that nobody else is disrupted. Fifty-fifty fairly major architectural changes tin exist done without throwing away the code. On the Juno projection nosotros spent several months rearchitecting at i bespeak: only moving things around, cleaning them upwardly, creating base of operations classes that made sense, and creating sharp interfaces betwixt the modules. Just nosotros did it carefully, with our existing code base, and we didn't introduce new bugs or throw away working code.
A 2nd reason programmers recall that their code is a mess is that it is inefficient. The rendering code in Netscape was rumored to be slow. But this only affects a small part of the project, which you tin can optimize or even rewrite. You don't take to rewrite the whole thing. When optimizing for speed, 1% of the work gets y'all 99% of the blindside.
Tertiary, the code may be doggone ugly. I project I worked on really had a information type called a FuckedString. Another projection had started out using the convention of starting member variables with an underscore, but later switched to the more standard "m_". So half the functions started with "_" and half with "m_", which looked ugly. Frankly, this is the kind of matter you solve in five minutes with a macro in Emacs, not past starting from scratch.
Information technology's important to recollect that when you offset from scratch there is absolutely no reason to believe that you are going to do a ameliorate job than you lot did the first time. Kickoff of all, you probably don't even accept the aforementioned programming team that worked on version one, so you don't really accept "more experience". You lot're just going to brand most of the onetime mistakes once more, and introduce some new bug that weren't in the original version.
The erstwhile mantra build one to throw away is dangerous when applied to large scale commercial applications. If you are writing code experimentally, you may want to rip up the function you wrote last week when you think of a better algorithm. That'due south fine. You may desire to refactor a class to make it easier to use. That's fine, too. Only throwing away the whole program is a dangerous folly, and if Netscape actually had some adult supervision with software industry experience, they might not have shot themselves in the pes so badly.
Source: https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/
0 Response to "Make Historic Transom Windows Work Again - Nailed Shut"
Post a Comment