The title of this blog comes from the fact that I believe software code strictly follows the second law of thermodynamics. Here are a couple of the English-language formulations of that law (from the Wikipedia article):
- In a system, a process that occurs will tend to increase the total entropy of the universe.- It is impossible to convert heat completely into work.- The entropy of the universe tends to a maximum.
The idea of “software entropy,” or that disorder slowly creeps into evolving software code, isn’t new; it’s certainly not my invention.It just strikes me that not only is there such a thing as “software entropy” or “code entropy,” but that such chaos in code is in fact inevitable, much as the second law states that entropy is inevitably increasing in an isolated system. (And yes, I’m aware that entropy != disorder in a meaningful sense in chemistry or physics; I’m using the word in its popular sense.)I think there are plenty of people in the software industry who can share stories of increasing disorder in a system’s design and code, and I think that much of that disorder occurs despite the best efforts of many bright people to prevent it. There are even theories and processes which attempt to embrace and manage that disorder, which says something about how prevalent it is in the industry.But I personally think “software entropy” is more than something we need to guard against or manage.One implication the second law, as I understand it, is that when energy or heat moves from a hotter region or object to a cooler one, the net change in entropy of the system is always an increase. And when work is applied to a system to move heat or energy from a colder region to a hotter one to increase the heat of the hotter one, energy is always “wasted” and there is always a net increase of entropy in the system.I think this is true of software code. We can attempt, through rigorous standards and processes, application of our most senior staff, careful design, etc. (in other words with a great deal of “work” expended) to reduce the disorder in one application or one region of an application (for example via a rewrite or redesign, or through an extensive refactoring process), this effort always results in a net increase in disorder in other regions of the system. Either our standards cause unintended problems or consequences, or we’ve pulled senior staff from other projects and those projects suffer, or we stop paying attention to the code of application A to focus on reviewing application B and the code of application A gets worse.So I’m going to writing about software design and construction, and “software entropy” is one of the things I’ll be considering on the way.I’ll leave with the following quotation (also from the WP article) that sometimes seems apt for the software industry:
The tendency for entropy to increase in isolated systems is expressed in the second law of thermodynamics – perhaps the most pessimistic and amoral formulation in all human thought.- Greg Hill and Kerry Thornley, Principia Discordia (1965)
[edit: I corrected a few typos and errors]
