March 20, 2002

I was reading a recent interview with Joel Spolsky, and Joel pointed out something intriguing about the mindset behind his detractors.

For those who aren’t familiar with Joel, he is arguably most famous for his mantra, “Never rewrite code from scratch.” To be honest, this statement is more rigid than Joel’s real beliefs, since he believes in code cleanup, refactoring lousy code, very small code rewrites, and complete rewrites of applications (but this latter only in extremely rare circumstances).

Here’s one Slashdot response:

“BUT JEEZ, should you hold on to a payroll system written in FORTRAN69 (or LISP or ALGOL or FORTH…), just because it works, even if you have NO OTHER apps in FORTRAN and don’t have one single FORTRAN programmer working for you????”

To be honest, when I first read this statement, I just kinda nodded to myself. Nothing seemed particularly strage. However, to illustrate that intriguing aspect of the detractor’s mindset, let me cut off about half of that statement.

“BUT JEEZ, should you hold on to a payroll system written in FORTRAN69 (or LISP or ALGOL or FORTH…), just because it works?”

I’ll edit it again, to emphasize my point:

“BUT JEEZ, should you hold on to a payroll system written in FORTRAN69 just because it works?

Heck, yeah! The system works! Why mess with it just because it’s written in a boring language?

Well, obviously, you might be afraid that something’ll happen to the system. Well, what if something happens? You hire a consultant, and he or she fixes it. No need to rewrite.

Here’s a crucially important aspect to the debate about rewriting code, one that I think many people miss: Rewriting code takes a lot of time and is error-prone.

Let’s use that FORTRAN69 payroll system as an example. Let’s say it’s a medium-sized program, with 50,000 lines of code. Let’s say that the system somehow becomes unusable because of something in the code, which affects 10% of the code. Which do you think will be more expensive?

  • Paying several expensive in-house programmers to re-write 50,000 lines of code in C++, or
  • Paying an expensive consultant to fix 5,000 lines of code

Somehow, I doubt that the consultant will be ten times as expensive as the in-house programmers, and since he’ll be fixing and cleaning code instead of rewriting it, he won’t have as much to do.

But that’s not the whole picture. Any time any human writes software, that human will probably introduce bugs. How many bugs do you think will be in the new 50,000-line C++ program compared to the consultant’s 5,000-line fix?

Now, certainly, there are times when an application needs major work. But don’t throw out 95% of your code just because 5% of it is bad.

OK, I get a kick out of stumbling across a website that reminds me very much of my own personal website. It’s fun to see someone else who think like I do, at least on some level.

Today, it’s, the product of Wing Chun. After skimming the rants about TV shows, I discovered my favorite section: The Bad Teen Novel. It’s a novel that Wing wrote when she was 13, and you can imagine its quality. Ouch. It stinks, and she knows it stinks, but she posted it on her website anyway so that anyone can read it. It’s great stuff. Even better, Wing has inserted her own commentary into the prose.

You can even buy a shirt inspired by it, with the Bad Teen Novel logo on the back.

Leave a Reply

I work for Amazon. The content on this site is my own and doesn’t necessarily represent Amazon’s position.