Things You Should Never Do

[…]

We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by incremental renovation: tinkering, improving, planting flower beds.

There's a subtle reason that programmers always want to throw away the code and start over. The reason is that they think the old code is a mess. And here is the interesting observation: they are probably wrong. The reason that they think the old code is a mess is because of a cardinal, fundamental law of programming:

It’s harder to read code than to write it.

[…]

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.

[…]

When you throw away code and start from scratch, you are throwing away all that knowledge. All those collected bug fixes. Years of programming work.

(Joel On Software)

Das Essay ist ein wenig in die Jahre gekommen, aber immer noch unbedingt lesenswert. Joel Spolsky hat sein Handwerk u.a. als Chefentwickler Anfang der 90er bei Microsoft gelernt. Wenn ich – einmal mehr – durch seine Texte gehe, bleibt mir nichts übrig als einzugestehen, daß seine Prognosen wiederholt von den tatsächlichen Verhältnissen bestätigt wurden. Insofern macht der Versuch wenig Sinn, seine Einsichten beiseite zu fegen mit dem Argument, heute sähen die Umstände ja ganz anders aus.


Nachtrag: ich hatte schon auf einen Blogeintrag von Kristian Köhntopp hingewiesen (und kurz kommentiert), der das gleiche Thema aus einer anderen Perspektive behandelt.