Blog

Elegant Design = Minimal Degrees of Freedom

The concept of Degrees of Freedom (DoF) applies to software as well as it does to so many other fields. It is an important metric because of its many consequences: ease-of-use, cost-of-maintenance, volume-of-documentation, … to name a few.

Elegance of Design is a more intuitive concept. It is neither absolute nor discrete. However, we can get a measurable sense for it if we observe that Elegance is inversely proportional to Degrees of Freedom.

Therefore, we increase the elegance of our design by constraining (or sometimes hiding) degrees of freedom.

We do not use 5 Boolean variables when a single Enumerated type will do (e.g. when representing discrete modes of operation). Thus the source code is more simple to understand and modify. And the cost of maintenance is lower.

We do not require two dimensional coordinates for plotting a regularly sampled log curve. It meets the strict definition of a function, thus a scalar array is all that is needed.

We do not use three Text Boxes when a single Range Slider will suffice. Thus the interface is more clear. And, documentation, training and manual testing costs are reduced.

Naturally there is an initial cognitive cost to creating succinct expressions. We mind that cost too. But it is usually time well spent.

Hank Beasley

View all posts by

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *