Chapter 22. A Spoonful of Sewage


If you put a spoonful of sewage in a barrel full of wine, you get sewage.

Schopenhauer’s Law of Entropy

Unlike most things that we engineer, software has a binary notion of correctness: either it is correct, or it is flawed. That is, unlike a bridge or an airplane or a microprocessor, software doesn’t have physical parameters that limit the scope of its correctness; software doesn’t have a rated load or a maximum speed or an environmental envelope. In this regard, software is much more like mathematical proof than physical machine: a proof’s elegance or inelegance is subjective, but its correctness is not.

And indeed, this lends a purity to software that has traditionally only been enjoyed by mathematics: software, like mathematics, can be correct in an absolute and timeless sense. But if this purity of software is its Dr. Jekyll, software has a brittleness that is its Mr. Hyde: given that software can only be correct or flawed, a single flaw can become the difference between unqualified success and abject failure.

Of course, this is not to say that every bug is necessarily fatal—just that the possibility always exists that a single bug will reveal something much larger than its manifestations: a design flaw that calls into question the fundamental assumptions upon which the software was built. Such a flaw can shake software to its core and, in the worst case, invalidate it completely. That is, a single software bug can be the proverbial ...

Get Beautiful Code now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.