Skip to main content

Local rules give global results ➡

It’s easy to think that large results require large changes. That is not necessarily true.

Reading Richard Dawkins’ book The Greatest Show on Earth, I got inspired by his description of genes. He talks about how genes are not the blueprints of the body, but rather a recipe for the body. In other words, the genes do not contain a complete (or even partial) description of the final result, but rather contain various instructions for how to create the body. Each gene contributes only with extremely low level instructions, yet these instructions combine in almost incomprehensible ways to form our enormously complex bodies.

A large arrow made of small arrows.

I very much liked the idea, that a set of very low level instructions, carefully chosen and diligently followed, could create something so complex and beautiful.

It is similar to how ant hills or bee hives are complex structures created without a master plan through the actions of individuals. Another fascinating example is some species of firefly where thousands of individuals synchronize their flashes by adjusting their own flash timing based on their neighbors.1 Example from computer science include Conway’s Game of Life or local search algorithms which find maxima in a landscape through looking only at their immediate surroundings.

My brain started linking these ideas to software development. For example, Test-Driven Development. It is in its essence, a set of very simple rules. Write test, implement, refactor. These three simple (at least in theory) steps is all that there is to it, yet when followed it can give great results. Designs tend to be easier to use, contain less bloat, and be more testable (duh!).

Choosing the right set of rules to follow is the hard part. A bad set of rules may lead to bad code, just as an unwanted mutation in a human body may lead to e.g. cancer. But no matter if the results are good or bad, there is immense power in following simple rules.

What simple rules which give surprising results do you follow in your life?