When Rewriting an App Actually Makes Sense
vlangber writes "Joel Spolsky wrote a famous blog post back in 2000 called 'Things You Should Never Do, Part I,' where he wrote the following: '[T]he single worst strategic mistake that any software company can make: They decided to rewrite the code from scratch.' Here is a story about a software company that decided to rewrite their application from scratch, and their experiences from that process."
5. When it is written in Visual Basic. Always.
4. When I'm getting paid by the hour and it is written in Visual Basic. Always
3. When it was written in a mid-90s WYSIWIG bastard child of a mid-80s interpreted language.
2. When it uses a thousand "IF-THEN-ELSE" when it means to use regular expressions
1. When it is written in Visual basic.
Just a reading comprehension test.
You fail by the way. Epically.
Truth arises more readily from error than from confusion. -Francis Bacon
I am about half way through the article in the second link, and it is really interesting, and informative. :>
Maybe not news, but it is worth your time (or at least mine).
Joel was pointing out a case where an application was rewritten IN THE SAME LANGUAGE. These guys rewrote their application to move it to a new language / platform. It's not a REWRITE, it's a PORT.
If you bothered to RTFA, then you would see that this was a posting about a blog entry that is only two days old. It is a discussion about a current rewrite project and their comparison to the blog posting of ten years ago.
Hi!
I'm the author of the blog post. The Joel article is 10 years old, but not the one I wrote(the the second link).
Vidar Langberget
you must stop looking backward.
First, I suspect everyone agrees that rewriting an app rarely makes sense for a small company with limited R&D budget like Spolsky's. (Better spend whatever money there is on comfortable chairs and parties for the summer interns, right?)
But if you have the budget and market share you have some good reasons to rewrite from scratch:
1) You can generate fresh revenue by forcing your users to upgrade due to icompatibility issues.
2) You can ease the burden of backward compatibility by creating a new baseline.
3) You can strengthen your old brand by coming out with a "new coke" that is so crappy that everybody will clamor for the old stuff.
4) There might be (unforeseen) technical or architectural issues that make a rewrite a sensible option.
You take the plunge and do a full rewrite from ASP ... to .Net 2.0?
That was a golden opportunity to move to an opensource stack. If it had been PHP for example, the complete rewrite probably won't have been necessary. Just replace the depreciated functions and constructs as required.
(PHP is just an example. No language flaming idiots please.)
Drupal does indeed brutalize your database (see second link). So looking forward to D7 to clean this up. That alone was sufficient justification to rewrite the application :p
Unfortunately the author goes on to display his ignorance before this is all over: There are also other examples of total rewrites that have been successful. Apple's transition to OS X is a very good example. The classic Mac OS was an operating system with some good ideas, but the core architecture had a lot of problems. Did Apple make a bad decision to start from scratch with OS X? I don't think so. They brought over and improved the best bits from OS 9, and merged it with the solid Darwin core (much like we did). Uh, no, you are totally and completely fucked here. They started with NeXTStep, last updated in 1995; it was itself based on an older version of BSD (4.3?) and an older version of Mach. OSX is not a complete rewrite of anything. Its legacy stretches back into the 1980s, and so does its code.
"You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
The problem is that companies usually rewrite for all the wrong reasons.
A good reason would be the emerge of a new technology that supports your problem much better, to the point where redoing your code from scratch means easier maintainance later. Usually this goes hand in hand with an old technology (the one you used so far) getting abandoned by its maker. A good example would be how I had to maintain a client/server app written in VB6 using DCOM. Not some quick hack, a full blown client/server solution it was never meant to be, that also has to communicate with a SAP interface and a few more nifty things that cried out "please rewrite me". The overhead to maintain it soon turned from insane to nuts and even the tinyest change required a team of four people to work for weeks.
Unfortunately, the reasons why something gets rewritten are usually different. Like at my next gig. A pretty well designed and fairly solid piece of code was thrown out when the original creator was fired and someone with an ego that required its own office took over and insisted we use "his" collection of libraries instead of that "old" libraries. We trashed about 2 manyears of labour down the drain to end up with what we had before.
We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
I just looked at their article, and 6 KB of the page was near-useless VIEWSTATE data. If they can, they really should disable the generation of that. It's a useless artifact of the broken ASP.NET WebForms approach, which isn't really even necessary for a blog like theirs.
Seriously, with a typical Slashdot posting resulting in 80,000 unique hits for the target site, they're going to waste over 480 MB of bandwidth serving up just that useless VIEWSTATE data.
"App" is Trademark(TM) to App le computer inc. If you try to use it for your own stuff not app rove by app le expect to receive in iNjunction.
It's a bad idea to roll your own. In fact, Joel Spolsky (Who's comment this blog post is the basis of) even went on to explain that in some cases, that's a complete lie (http://www.codinghorror.com/blog/2008/10/programming-is-hard-lets-go-shopping.html)
So really "It's a bad idea to roll your own, except when it's a good idea".
I've seen rewrites/ports go quite well. Systems that were originally on mainframes and needed or wanted to be moved to cheaper hardware for cost - if it was the proper thing to do (Sometimes you really need the metal).
Another rewrite that went well was a bunch of code that over the decades became so convoluted to be a maintenance nightmare - modify one thing or add on functionality and then break a shit load of other things.
Just do these basica things and it'll work out.
Go back to the specs and start there.
Talk to the stake holders - yep, there will be creep but also feature reduction because there are things that they never used or because it doesn't make sense anymore.
Plan, plan, plan. No cowboy programming and hacking out shit. And document everything.
It can work.
RIP America
July 4, 1776 - September 11, 2001
How long did it take you to bring "version 1.0" from concept to new product to the "2.0" version that the market considered useful and bug-free?
Use that as a starting point for how long it will take to do a rewrite, then adjust up or down for things like:
*how many features will be in the rewrite that weren't in the 2.0 version (e.g. a rewrite of MS Windows today would take much more effort than writing MS Windows 3.1).
*time already invested in internal projects that will be used in the rewrite version (e.g. experience writing the NeXT OS greatly reduced the time it took to write MacOS X 10.0).
*other factors too numerous to list here.
Sometimes it makes sense to treat your pre-release product as a throwaway prototype rewrite BEFORE you go to market. Yes, this means starting the testing cycle all over again, but it gives you an opportunity to correct design flaws or maintainability-killing bugs while you still have a chance. Unfortunately, sometimes the competitive marketplace forces you to go to market with what you have, a bug-ridden, nearly impossible-to-fix product that will make a little money so you can have the funds to redo it from scratch for version 2.0, er, version "II, 1.0."
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
The article says that any developer will tell you that they want to rewrite the code they are working on. It claims it's because it is harder to 'read' code than 'write' it.
I disagree.
I want to rewrite my old code at work... But only for one reason: I am a lot better programmer now than 5 years ago. And 5 years ago, I was a lot better than 10 years ago. And in 5 more years, I have no doubt I'll feel the same way.
Code I write today is cleaner, easier to read, more efficient, and easier to work with for new projects.
"If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
... and most of them run in a controlled environment (server-side). So lots of Joel's advice is not going to apply.
Then they have the balls of comparing their move to the transition from Mac OS 9 to Mac OS X!
In the end, while their story is interesting, it adds really little value to the "Rewrite/No Rewrite" debate.
Nobox: Only simple products.
Netscape's rewrite might have cost them market-share at the time, but Internet Explorer is back at trying to catch up with Firefox, which might be easier to extend because of that newer codebase...
(And from when I forgot to log in: And WTF is up with the captcha? It doesn't change, even when it is obviously unreadable (A 8 / a / 0 with a line through is hard to make out with 2 guesses))
rewrite ONLY if it means it yields less lines of code to maintain with the same functionality. Use whatever language necessary to keep the length of code to a minimum.
If the code doesn;t look as if it has been refactored even once... junk it.
I'm going to forward your blog post to several clients and colleagues. The clients need to see why I make sure they know what they want before we start development (they never understand how hard it is to change infrastructure on the fly or just "do it again"), and the colleagues because they need to stop selling one product as something else that can "do what you need with just a little bit of tweaking".
... until we sell it to someone else who wants "just one little change ...".
We do some small custom web apps for clients, and even a few that have the potential to grow into bigger (but not big) products. While rolling out one of them this week, to the first of three clients who have ordered it, I'm already designing a complete re-write of the core of this product. What started out as a small helper app for one client has turned into a PITA to scale up and out for these other clients. Clearly it's better to fix it now than to keep patching & splicing in order to make it work for them
We had one of our apps Sausage Machined, very sad... Translate one chunck of code into worse code in another language and different platform. A complete from scratch re-write would have been SO much cleaner (and maintainable).
Rewriting an application can work if the developers know what they're doing. However, these rewrites are often side projects. If considerably more resources are spent to extend the original application, the rewrite will be behind until it gets cancelled. On the other hand, a rewrite is always a risk and betting your company on it is insane. In most cases it's safer to refactor the original implementation, even if it's more work than starting from scratch.
I noticed that your regular expression doesn't allow the plus sign as a valid character in e-mail addresses. For example, a lot of e-mail providers allow receiving mail at, say, pino+regexlib@example.com, which gets put in the same mailbox as pino@example.com but tagged with "regexlib". See here for instance.
When your "enterprise" ERP application is written in VB6 with a roll your own alternative to ADO, half your business logic is in stored procedures that can be 5,000 lines long and 30% to 40% of your code was written to spec B.
5 points if you can name that product
I still cannot find the droids I am looking for...
Look. Spolsky runs a dinky little software development firm that sells a little project management program. And it's still a dinky little software development firm after a decade. It's not like this guy runs a company that does anything critical, like avionics software, or anything really big and tightly integrated like Facebook, or financially significant like Chase's banking system, or leading-edge robotics like Boston Dynamics, or cutting-edge manufacturing like HyperMill. No, they just do Windows and Mac desktop apps. That's trailing edge technology at this point.
Some of the better shops don't hesitate to rewrite. Some have systems which intercommunicate by message passing and are designed to be rewritten in sections. (Facebook, works that way internally.) The bigger shops may have one team on the new version and a maintenance team on the old one; a small firm may not be staffed for that.
Two programmers were tasked to convert the Atart VCS/2600 game Pitfall 2 to a Commodore=64 and Atari 800 computer. One said, "The Atari console is so primitive that it's easier to recreate the whole game from scratch," and the other said, "No just copy the 6502 code and then modify it for the varying graphics/sound chips."
But then how would one have ported a 2600 game to the ZX Spectrum, ColecoVision, MSX, or Sega Master System, all of which use a Zilog clone of Intel's 8080 CPU?
From the article: "we experienced a lot of the hardship and trouble that he talks about, so we can easily see how many companies could get into trouble during such a process. If the board of directors had known in 2005 that we wouldn't be ready to re-launch in the international market until 2010, I doubt we would have gotten the green light for the project. "
And that says it all. In this case, it worked out; but it was quite possible that during that 5 year window with no releases that a new competitor could have emerged with a few new features, and these guys wouldn't have been able to respond since their code rewrite was still years away from being ready. Everytime a customer said "We'd love to buy your product but your competitors have feature X and you don't", these guys lost a sale since they couldn't counter "well, we have a new release of our coming out in a couple months with new features". Spending five years rewriting code from scratch instead of incrementally improving the existing code and doing a new release every year could quite possible have caused a company to run out of money and go out of business as customers moved on to the competition.
The reason to iteratively refactor your existing code rather than rewriting it from scratch isn't cause it produces a better end result -- it's cause iterative improvements allow you to periodically stop and ship a release every six months or a year (with one or two new features and a slightly cleaner code base) and then continue refactoring again for the next release. But rewriting from scratch means you can't ship a release for (in this case) ***5 years***. And the world may well have forgotten you by then.
We faced the same challenge at our company recently.
My company publishes a CMS for specialized niches.
The product started around 2002, and we developed it without real direction, since we added functionalities as we needed them.
The first years were great, since we were the only ones to release such a tool, but some concurrents emerged after a few years, proposing a much cheaper alternative.
As we built the project without long-term view, adding new functionalities took more and more time, since the codebase was hard to maintain (for information, we mainly use VB.NET with a lot of XSLT).
Two years ago, we realized that the interface could be improved for the customers, but it was impossible to do it with a reasonable amount of effort.
Thus, the CEO decided to start a new product, and we used an interesting approach: the customers approach (or technically, BDD, behaviour driven development).
The idea is to describe scenarios and implement them one after another, using agile methodologies.
For this kind of approach, you really need to hear about your customers, and write the scenarios that they need, and it's obviously impossible when you start your company.
The project is now radically different, but not yet released, since it's really a subset of the previous project.
What we discovered is that we needed to maintain the old codebase, because our consultants still used it, and it is difficult to sell the new project, since it's really different.
So I would suggest that if you want to totally rewrite your codebase, you need to place a few resources on maintaining the original project, since it won't probably die before a long time...
Here' let me help you :-)
Einstein said something about making the same mistake and expecting different results ...
I agree. I don't know why slashdorks (or anyone else) sucks his e-cock. He's a former MS mid-level manager. If anything he writes strikes you as intelligent, insightful, or advice worth following, you're probably totally lacking in common sense or real world experience.
Einstein said something about making the same mistake and expecting different results ...
No he didn't. That was Rita Mae Brown in her book Sudden Death , but that never sounds as dramatic or important as claiming it was Einstein.
"I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
Mostly agreed, and I'll sign my name to it.
Spolsky's got some decent ideas, and knows a lot about what he talks about, but his idea of "good" and "bad" makes me cringe. He's one of those folks who's built up a following on what little they had to talk about, then ceased to think further. Now (and for several years), he writes about half-baked lists of do's-and-don'ts that never even come close to covering exceptions.
You do not have a moral or legal right to do absolutely anything you want.
Don't worry about refuting a zealot, the two technologies have pretty much nothing in common anyway.
Not that I'm a fan of either approach, exactly, but this was just a cheap jab at Microsoft based on prejudice. You should be expecting that around here by now, your user id is low enough.
I'm the author of the blog post.
In that case, would you mind explaining something that is confusing me, please? It sounds like you started the rewrite in early 2005, planned to release in mid 2006, and actually had a finished product in early 2007, which isn't on schedule but is hardly unheard of for a software project. However, you then seem to jump to saying the new version wasn't available across your entire international market until 2010. What happened in between?
I have been through a similar project - rewriting a solution that did run under OpenVMS using Basic, Java, C++, C and a bunch of DCL scripts (that confusingly enough for DOS persons have the file extension .COM)
Target environment was Linux and language used was Java 1.6.
My experience when rewriting a legacy system that have a crapload of varying solutions that has evolved during 25 years or so you will find that there is always yet another functionality that nobody told you about - effectively doubling the development time. (This "Multiply estimated time by PI factor" statement isn't that far off.)
And there were some traps involved too - migration of the system had to be seamless for the users as much as possible and with minimal downtime. Since there were over 400 different customers with everything from 1 to 1000 users each involved this was to say the least "tricky". Especially since this was a 24x7 system. The solution was to write a replication protocol that replicated data between the old system and the new. The old system used OpenVMS indexed files while the new system runs a MySQL database and the data structures were different too, which made it necessary to write a replication solution. So when a customer was migrated it was effectively done by setting a flag that redirected them from the old system to the new system and they could continue working.
Of course there were bugs in the beginning, and user errors since the new system did have different functionality and behavior compared to the old. Bot none of them were causing any irrecoverable problems. Invoice printing was delayed, but no major amount of money was lost. The majority of the problems appearing didn't affect the end users at the customers, only the helpdesk service personnel and they were prepared for limitations ahead of time.
The amount of downtime for the system during the two years it has been operational has been very low. And this has given a different concern - too few "problems" with a system is also a problem because tech support will almost forget that it exists.
Specific problems with the application - especially in the beginning has been running out of PermGen space in Java. This at least partly due to design mistakes. But memory leaks that grows over time are very low. And the use of FindBugs has been very useful to trap a lot of errors (potential and real).
What the application does? - It's a management application for short-term lease of telephony at hospitals and similar (almost 400) and other services (a few) which enables and disables phone extensions, assigns numbers, allows instant move of an extension and provides invoicing for the rental and phone usage through processing of CDR:s.
If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
Real artists ship.
"I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
I tried to C&P the link contents in but /. said "Filter error: Please use fewer 'junk' characters."
"I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
That old crappy code has undecipherable bug fixes for 100's of obscure difficult to reproduce bugs. Many of them which could be hit only under really strange customer usage scenarios & which tooks days to reproduce, days to fix & many more days to fix whatever the fixes broke.
So unless you original software fully automated testsuites covering every functionality & you have added a bug fix verification test for each bug which has been fixed since then, do not rewrite something from scratch.
TFA says they released their software 2006, and expected it to be in use for at least 10 years. I realize the benefits of DotNET, quick development, compatible with the most popular platform. I don't think there was any mistake in starting from scratch, in and of itself. And I don't think the downside of developing in DotNET has even materialized yet, and so long as the product pays for itself before it becomes obsolete, I think they're OK. But I have a feeling that, and I admit my prejudice, that the devs were blind to any other possible solution because of Microsoft. DotNET was they're ONLY option... never even considered that it was, never considered anything else... never considered. If a mistake was made, that was it... and again, it may not make any difference because the product may still be successful even with lock in. But there is no doubt they're software will not be a major player in 2016 having been developed in DotNET.
The Admin and the Engineer
Don't worry about refuting a zealot, the two technologies have pretty much nothing in common anyway.
I don't think the difference in technologies is actually relevant to his point. If company X is known to make unreliable products for reasons relating to corporate culture, then "use tech A from company X" and "use tech B from company X" are essentially the same mistake even if tech A and tech B are automobiles and recombinant gene therapies. I think that was more of his point. Having used Visual Studio fairly extensively (in the pre-.Net days) I'm also inclined not to use ASP or .Net based on my experiences even if they bear nothing in common with old VS other than company of origin.
I was just taking issue with the Einstein citation, which bugs me every time I see it because it's so blatantly false and it contributes to spreading ignorance.
"I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
Often a rushed, under-resourced or under-skilled s/w project will congeal into a large, brittle, solid clot,
which is not extendable without breaking things in mysterious prohibitive to fix ways.
Congealment comes from insufficient or ill-conceived architecture, and/or rushed or ignorant ill-fitting extensions or mods or "fixes",
combined with insufficient continuous re-factoring.
This code may be worth keeping on expensive life-support if there are many existing customers depending on it,
but make no mistake. Your codebase is already dead, even if its heart still beats.
So then, if you still need software with similar but slightly updated or extended functionality, you should rewrite,
and in doing so, make sure you get good architecture, take sufficient time to build each part or layer, evaluate the quality of
all third party libraries or frameworks used (on the "volleyball" principle that the weakest member of the team drops the ball
and determines the team's i.e. the system's quality), use continuous refactoring, with technical-risk based work prioritization
(biggest risks dealt with first, always), document the classes and methods
sufficiently, and include unit tests and/or invariants and pre-postconditions, so that there is a lower probability that
further extensions will start congealing into brittle, excess complexity.
If you can succeed at maintaining that discipline without going bankrupt, then it will have been worth it, because the value
of your new software capital asset will be much greater than previously.
Of course you should have done it right the first time, (and should have had management enlightened enough to let you,)
because it would have been much cheaper to do it carefully once, than the punishing expense of the original crappy
development and maintenance plus the rewrite. There IS a valid argument that by the time you let your s/w congeal into
a complex, brittle clot, you are already too late, and you should pull the plug, shed a tear, and walk away.
Where are we going and why are we in a handbasket?
I've always thought his article on this topic skipped over dealing with the fact that rarely, if ever, is code so perfect that it wasn't at least a little 'rusty' in the first place. There's only so far you can go with refactoring before it would just be more efficient to start from scratch.
Whether to do The Big Rewrite always boils down to one very simple question: do the expected gains outweigh the expected losses?
Usually, the argument against doing a rewrite boils down to two key points:
Those are certainly valid concerns, and IME it is often true that their impact is underestimated. However, what the doomsayers tend to ignore is all the potential benefits from writing a second version of something from scratch but with the experience gained from doing it once already:
I’m sure some rewrites really are just because a developer wants to write something new instead of working with what is already there, and those are almost always a bad idea IMHO. On the other hand, it can be annoying if someone comes in assuming that this is the only possible motivation for a rewrite, without considering whether there is another justification for the decision.
He spent 3 years dead for tax reasons.
I'm not a real programmer. I used to play with BASIC back 25 years ago or so and I've fooled around with writing C code for microcontrollers a bit lately but my skills are very limited to say the least. None the less, I was able to parse that regular expression without too much trouble. That leads me to believe that it can't be all that hard for someone who codes for a living to understand it. Still, it would be helpful to spend a minute or two with some helpful commenting.
This ain't rocket surgery.
The consulting part of the company used the new version since 2007, but it's a totally different ballgame to sell licenses to partners around the world, than implementing projects within a relatively small group of developers. If you're selling to 3rd party developers, you need a stable and well documented system, with all features found in competing solutions.
but this was just a cheap jab at Microsoft based on prejudice.
Prejudice is judgment without facts. I'd say this was more of a cheap jab based on decades of experience.
I worked for a company that rewrote the same application three times in different technology. 2 time using MS .net tech - aspx, .net desktop, and 3rd with PHP.
The first incarnation was a disaster from a performance/scalability point of view, but we did learn the (surprisingly complex) business requirements very well.
The second incarnation was good, developed quickly, but missed the target market -- nobody wanted a desktop app
The third performed much better than either predecessor, was simpler to maintain, and actually made money... still is.
There was some desire to rewrite it a fourth time, but that has been abandoned in favor of extending the existing system has been the current methodology.
The lesson here is "if it sucks, rewrite it". And more often than not, it is too costly to not rewrite it. Specifically, if the system was not rewritten a third time, the company could not (and would not) exist. As it sits, the product is quite good at what it does. The balance is looking 5 or 10 years forward and looking 1 year forward. If the system you are using won't last 1 year forward, let alone 10, a rewrite may be needed, duh!
The second lesson is "if it is not perfect, fix it". (In the third case it would last a year, but fixing it would maybe make it last 3 or 5 -- it's going on 5 now, and is looking good for another 5)
What this person seems to be faced with is the same thing as that of COBOL ... asp is old tech, nobody really wants to work with it, and it definitely is not perfect. A rewrite is the only sensible thing. (And yes, anything in COBOL should be rewritten too.)
Joel's position contradicts a paper I read years ago in an IEEE software journal that basically said you needed to plan on rewriting your application about every 7 years or have it collapse on you. The logic in the paper was based on two things I've found to be true in the real world. First, the world changes. Individually it's small changes, but looking at it on the half-decade-to-decade scale it can add up to huge differences in what's needed in the software. Second, software isn't infinitely extensible/adaptable. Any software has a basic architecture and world-view, and a limit beyond which it can't be pushed without an exponential increase in the time and effort needed to successfully make the changes. The two combine to mean that at some point it simply becomes technically infeasible to extend and adapt an existing system. The requirements have changed too much and you're having to fight the system trying to make it do, not just what it wasn't designed to do, but what it was actively designed not to do.
Now, business doesn't like this. It doesn't make sense from a business perspective, and it'd be much better to simply keep adapting and extending what's already there. But that ignores the fact that something must be technically feasible before you can even ask whether it makes business sense. If you've got the best idea in the world that'll make the business tons of money while giving you a virtual monopoly in the field and reducing costs by 99%, that basically is from a business standpoint the absolutely ideal thing to do, but it requires the manufacture of say room-temperature superconducting wire by the mile, then it just ain't gonna happen. How desirable it is from a business perspective doesn't matter because it just isn't technically possible at this point in time.
I also liken it to building a 20-story office tower. It's tempting to start with a simple one-story building and slowing add to it until you've got what you want, but the foundation of a one-story building just isn't going to be able to support a 20-story tower. You might be able to get 2 or 3 stories out of it, but at some point you're going to have to tear the whole building down and re-do the very foundations themselves to support the greater weight.
The first article of his I read was on exceptions vs return values. It was on or just after April 1st, so I thought is was an April Fool's article, since every single thing he wrote seemed wrong. After reading it I scrolled up to verify the date and found out the text was several months old.
Usually, that's called wisdom and experience. Once burned, twice shy.
I went through porting a ~400K application to Java. It was written in an unsupported, obsolete, early 90'ies "drag and drop" RAD system with a relatively simple language core. The program was highly mature and very functional even for competing programs. To port it, I wrote a conversion program that converted it function-by-function to Java. Additionally, I reimplemented the runtime library myself. The system had a couple of interesting specialities that made it fun to convert, because they were challenging to emulate in Java. Some of it called out to native C libraries (via a JNI mechanism, that I also had to implement) but also a strange type of global variables where a variable was shared among multiple processes. Additionally, it was possible to link fields in the GUI directly to storage locations (i.e. row in a table could be linked to the text fields of a dialog) so that the two would update it each other. There were various types of reflection possible and some simple message system for GUI. It took around 6 months of work. The project had to be done very fast for strategic reason. A multi-man effort to rewrite the application had spent 2 years to port just parts of the application. Of course not all the benefits was derived from my automated conversion. The original code was not that readable by today's standards, and it became slightly worse through conversion. But not all the "hand-written" converted code was that readable either, and some of it has already gone through heavy refactoring. No one included myself got much understanding out of the code but at least modern tools like Eclipse can be used to inspect, debug and extend it. Still, now 4 years after the completion of the project the code is still in production. New functionality has been written from scratch but the old code is still a significant (decreasing but probably still around 50%) part of the full application and has been maintained via bug fixes. There's no plan to reimplement just for 'reimplementation's sakef' but they might get reimplemented when they have to be significantly extended. It was also a fun project for me to. However, the code for the runtime library I wrote, that bridges the gap between the conventions of the original runtime system and Java's ssystem, is a bit horrifying to say the least. Fortunately, once it was done it worked quite well and has required no fixing for years. However, actually I now have to look into it again to make it work on another platform. It feels like reopening the Chernobyl concrete sarcophagus ;-) Fun and challenging, but I only change something on the day's where I feel at the top of my game :P
The original 10 year old article is a classic and should be read by every manager who takes on managing software. It's been my experience that most rebuilds are driven by the idea that:
If we get on platform X, we will have a world beater because platform X will give us so many more modern features.
The problem is that most developers don't understand that rebuilding in platform X may take as long or longer to get to market as the original software will. Most often it is because the original development process was very organic and inexpensive and as the firm grew, more rigorous testing and project management skills were rolled in to deal with change management, preventing regressions on upgrades and such. All the benefits of platform X are eaten alive by increased costs and lost agility.
-- $G
Your problem is not one of software development, but a business problem. It sounds like you're trying to please every customer with every feature they ask for. Try to learn there's some customers you don't want, and there's really certain features they think they want, but really don't need. Some people get into this mode of trying to find every special case they might ever possibly need. Those kind of customers will bleed you dry unless you can either convince them otherwise, or fire them.
It also sounds like you're trying to generalize your products and re-use them. That's good, but if you're going to do that you really have to be disciplined about what you will do and won't do, and be willing to let a customer go if it doesn't suit your larger business strategy.
AccountKiller
And if you had the book "Mastering Regular Expressions" you would have seen that that regex was created by other code which refers to the grammar in RFC822, rather than being a magic blob of code stuck in the middle of the program.
Also, just how would anyone write *that* with a bunch of if-then-elses? You'd spend 8000 lines and it'd be slow. That regex, for all of its complexity, is actually very fast.
If this is true, then a rewrite of an existing application will always be a huge mistake. Joel is basically saying that developers don't benefit from previous experience, [b]a notion that I think is plainly wrong[/b]... All the [b]good developers[/b] I've ever worked with have been more than capable of seeing what works and what doesn't work in a solution, and would have been able to do a better job on the second try.
vlangber, see, benefiting from previous work only occurs with good developers, not with mediocre ones. So we have to look at what Joel said on that from that context. Many of Joel's writings deal with crappy/mediocre developers.
So it is true as you said, that it works... for good developers. Sub-par developers can also benefit from prior work if it was performed with competent developers, and only if the new work occurs in the same organization (and with the same competent developers from whom to learn.)
On average, and sadly, this is not the general case. There is more mediocrity than competency in software now (thanks to the Java/.Net universities), individuals who work year after year doing crappy work on crappy jobs with lowered expectations and dysfunctional modus operandi. They keep repeating the same crappy year of experience over and over. They wouldn't benefit at all from previous experience if they were tasked to rewrite something they did. Not in a million years.
The infamous "second system effect" can be countered by following the old principle, "write one to throw away" as long as you make sure that it's the second system that you throw away! Of course, this is often what actually happens in practice, but it is rarely what's planned. :)
...stupidity. Write a new application, don't re-write the old one. Don't promise to completely match the function of the legacy system with no downtime. If that's all that matters to your users/customers then they should stick with the legacy system and spend their money on something other than re-writing a working system in a fancy new programming language. Most of the time, a system grows over a decade or more and becomes difficult for new programmers to understand. Customers want a few simple changes and lazy, immature programmers say: "we can't change it because the old technology is no good, we have to rewrite it with the new technogloy" when they really just are too lazy or stupid to learn to use the old technology to make small changes to the existing system. I've seen this happen more than once. Never with a good result.
Einstein DID say, "We cannot solve our problems with the same thinking we used when we created them", which may be what confuses people.
I heard, this one time, a developer pulled a 40 hour shift and the image of Joel appeared in their coffee and wrote their code for them. Just accept Joel as your personal guru and saviour and you too will ship!
If you were blocking sigs, you wouldn't have to read this.
Quoting Joel Spolsky is the new Godwin's Law.
I'm just saying.
There is NOTHING in OSX which can reasonably be believed to have been invented (in any sense of the word) for OSX! Period, the end.
What about launchd? According to Wikipedia:
launchd is a unified, open source service management framework for starting, stopping and managing daemons, programs and scripts. Written and designed by Dave Zarzycki at Apple, it was introduced with Mac OS X v10.4/Darwin v8.0, and is licensed under the Apache License.
A project that starts October 2006 with a deadline of Dec 2006 doesn't sound like a big project. In fact, even including the slippage of 3 months to March 2007, that's not a lot of code complexity we're talking about. I've had a single feature that took more time than 3 months!
From the sounds of it, it doesn't seem like this project really counts. Completely rewriting an app that take 3-6 months is not what I think could be considered a high risk project. The rewrites that I've seen were for much much larger projects and they took years. One ended in success, and the rest were failures.
luckily we qualified for R&D grants from Innovation Norway, several years in a row, which helped quite a bit. It gave us the required time to make the base framework very solid and well-thought out.
Well, yes, if the government gives you money, why not spend it? Free money really skews the ROI.
Advice: on VPS providers
Agreed, it would me no mistake to rewrite Word from scratch and dropping 99% of that useless "functionality" that never really worked on the way.
I use several rules to guide when to rewrite.
They aren't hard rules: some of them contradict.
* If it works, don't fix it. Only rewrite if the cost of rewriting is exceeded by the benefit.
* Learn from history. Never rewrite without understanding the old version.
* If at first you don't succeed, try try again. If I wrote it, I can rewrite it because now I know how to do it better.
* Don't throw the baby out with the bath water. When I rewrite it, I try to reuse the good parts.
Invoice printing was delayed, but no major amount of money was lost.
Looks like it turned out better than rewrites in 1999/2000:
Nobody would accept the program. Entire crops were lost.
and so is anyone who listens to anything he says.
Are you saying that it's impossible that Einstein also said the same thing? That there's some Pauli Exclusion Principle of Aphorisms?
I'm sure that lots of people have independently come up with the same quote - because it's so OBVIOUS and so TRUE.
Are you saying that it's impossible that Einstein also said the same thing?
Yes. Not because of some exclusion principal. Because it's so stupid. People quote it as though it's a technical definition out of the DSM or something. Even colloquially, it's a piss-poor definition of insanity; it's really much closer to a definition of stupidity. Insanity and stupidity are not the same thing, any more than lightning is the same thing as thunder.
"I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
That's not such a great example. The DSM is pretty superficial, and sometimes dead wrong. Use it for insurance purposes, or as a shorthand to communicate (the latter is its' real use - but it's not the equivalent even of a man page). This is the same privately-published manual that had earlier versions saying lesbians and gays were mentally ill. Turns out that even today some of the psychiatrists on the various committees have "issues" of self-loathing with their own sexuality. They need to see a shrink ...
I'm not so sure that they're not related (playing devil's advocate). An insane genius is a pretty stupid thing. Insanity would then be a subset of stupidity. Speaking of which, since stupidity is relative, the supply of stupidity is limited (Einstein got that one wrong, just as he got the "unlimited universe" wrong :-)
Water likes A to B with the shortest route possible, and some take this approach to program design.
Others know the water stops flowing sometimes and know that whoever is around to experience it can read the river bottom to find out why.
Design for Supportability.
Not everything requires elegant logical precision or lean pictographic representations to get the job done.
That's not such a great example. The DSM is pretty superficial, and sometimes dead wrong.
My point had nothing to due with the accuracy of the DSM, but with the difference between technical and colloquial usage. The DSM gives technical definitions of each of the conditions, such as "A person has ADD if they regularly display six of the following ten behaviors:..." whereas it's more colloquial to say "You have ADD if you're often distracted by shiny things!" or "You lost your keys again? God, that's so ADD of you!" People often give the Rita Mae Brown quote as though it were a precise definition rather than a silly aphorism.
I'm not so sure that they're not related (playing devil's advocate).
And I'm not sure thunder and lightning aren't related (my previous example). In fact I am sure they are related. But they're not identical, so it would be rather silly to define lightning as "that loud booming noise that comes from electrical sparks between clouds and the ground." That would just confuse the issue.
"I don't care about the Constitution!" --Bill O'Reilly, November 17, 2009
So the project wasn't really complete in 2007? I mean, I've always considered testing and documentation part of a software project. Don't you? So your rewrite of the code was done in a couple of years, but the complete project, I'd say, took closer to five.
Apple didn't rewrite OS X from scratch. They bought NeXT and made their OS look vaguely OS 9ish.
Dude,
Your regex is a good reason to rewrite it. Here is alternative:
http://www.regular-expressions.info/regexbuddy/email.html