Sitemap
Shubham Saxena

Shubham Saxena

Product Engineer @Go-Jek.

Software Entropy

2 min readAug 22, 2018

--

I find it weird that these two terms, software and entropy can coexist in the same sentence, but as it turns out, it’s really a thing.

Let’s get going with a little bit of physics ( nothing to be afraid of 😜 )

Second Law of Thermodynamics

the total entropy of an isolated system can never decrease over time. Or in other words, the universe is always moving from order to disorder.

We can apply this to other aspects of life as well. If I stop actively maintaining my garden it will turn into a chaotic jungle of twisted branches and weeds. If I own a car, it will gradually wear down until it breaks down completely.

We can do work to maintain and even temporarily increase the order of things, but inevitably it all becomes less orderly. Depressing shit!

Get Shubham Saxena’s stories in your inbox

Join Medium for free to get updates from this writer.

Software is no different. It needs maintenance and work very frequently during its lifecycle to avoid breakdowns. Software entropy can be a good proxy for measuring the data points you need to fully understand and maintain your code base.

How to define software entropy?

Entropy is essentially a measure of randomness, and randomness in code leads to unmaintainable software. If you find your code is getting hard to maintain and work over, it’s probably good to look over some of the signals of high entropy.

How to measure software entropy?

Unmaintainable software has various properties. Some of these are subjective, but nonetheless provide a good indicator of high entropy.

As is evident, higher software entropy is rarely a good idea. What do we do?

Keeping it in control!

refactor, refactor, refactor!

refactoring is akin to taking care of your code much like clearing out weeds from your garden. Do it whenever you have the chance.

Thanks for reading!

--

--