The Invariants — Deep Insights for Programming & Business from the book “A Timeless Way of Building”

Justin San Juan
3 min readSep 23, 2022

--

In this article, I discuss key insights from the book, “A Timeless Way of Building” by Chrisopher Alexander — an influential British-American architect, and how they can be applied to programming to gain a new perspective in software development.

Photo by Samuel Sng on Unsplash

About the Book

On the surface, the book is about architecture, but at its core, it is about building things that last. From this perspective, the goal for both building architects and software architects is the same — to build something part of people’s lives that stands the test of time.

Meanwhile, in the realm of business, this leads to end results of low maintenance — reaching for a kind of fire-and-forget solutions. These are important since maintenance in software is costly and can significantly slow business innovation down.

The book focuses on two major concepts

1. The Invariants

This concept focuses on how identifying invariant forces, meaning the underlying forces that exist for all versions of the same problem, is key to build a timeless solution.

This task of identifying invariants is extremely difficult, and is mostly achieved through experience with deep thought.

This ties into the second concept, where the problem has to be thought of in the view of a system of forces.

2. The System of Forces

Each problem can be boiled down to a system of underlying forces where the solution has to strike a satisfying balance among these forces.

An example in the book is the need for a transition in the entrance of a building. Take, for example, a coffee shop. The store itself is not just a store but is marked by its location relative to a busy street and other facilities nearby. There is an intrinsic need for a change of environment when entering a store. The doors to a store are not simply doors, but a region for transition. Because of this, the book emphasizes the need for change in this region — a change in elevation, ceiling height, noise, smell, etc. These altogether form the pattern of ENTRANCE TRANSITION.

How Does This Apply to Programming?

In comparison, in computing, the system of forces have to be understood to solve the right problems. This can be done using Design Patterns — delegating and encapsulating work to subclasses that can be created in the future.

Take, for example, the Memento Design Pattern which establishes the functions needed to encapsulate state in a separate Memento class. By identifying that encapsulating state is a separate problem from how programs use the state, a timeless solution of mementos can be made.

By using this pattern, programs can be insulated from changes in the underlying implementation of the mementos. For example, if the memento uses local storage and is changed to use a remote database, no changes have to be made to the main program itself. This shows that the memento design pattern, as a solution, stands the test of time.

Conclusion

It is critical then to understand the core structure of the problem, and how the environment for the problem is a system of forces with specifically underlying forces that are invariant. It is only by identifying these underlying forces, then, that a timeless solution can be formed.

--

--

Justin San Juan
Justin San Juan

Written by Justin San Juan

Award-Winning Software Engineer | Business and Web Consultant