Why Programs Have Bugs

Marti Hearst, Computer Scientist, UC Berkeley, School of Information; Author, Search User Interfaces. Article excerpt.

From the earliest days of computer programming up through the present, we are faced with the unfortunate reality that the field does not know how to design error-free programs.

Why can’t we tame the writing of computer programs to emulate the successes of other areas of engineering?

In many creative activities the medium of execution is intractable. Lumber splits; paints smear; electrical circuits ring. These physical limitations of the medium constrain the ideas that may be expressed, and they also create unexpected difficulties in the implementation.

Computer programming, however, creates with an exceedingly tractable medium. The programmer builds from pure thought-stuff: concepts and very flexible representations thereof.

Because the medium is tractable, we expect few difficulties in implementation; hence our pervasive optimism.

In addition, just as there is an arbitrarily large number of ways to arrange the words in an essay, a staggering variety of different programs can be written to perform the same function. The universe of possibility is too wide open, too unconstrained, to permit elimination of errors.