1. Levels of Scale

In every modern high-level programming language, source code is organized into centers that span a vast range of scales. Ordered roughly from smallest to largest:

Christopher Alexander stressed that the mere presence of centers of different sizes was not sufficient to constitute Levels of Scale. In order for the whole to feel human-scaled and not alienating, the arrangement of centers must meet a few criteria:

These criteria echo the received wisdom that “a function should have 5 lines or fewer.” Obviously, this is not viable as a hard-and-fast rule, but it makes sense as a general guideline, and Levels of Scale tells us why. Each center should be simple enough to “fit in your head.” You should be able to see how each center relates to, and is made from, the centers one level smaller. Thus, a line should have only a handful of tokens, a method a handful of lines, and an object a handful of methods.

What would code look like without levels of scale? Well, imagine an assembly-language program where instead of procedures and calls, you just have jumps (i.e. GOTOs) within an undifferentiated mass of instructions.

A program written in this extreme style might have only two levels of scale — instruction and program. The instruction:program ratio might be several thousand to one. Even if you’ve never written or tried to read a program in this style, you can probably imagine the difficulty it would cause!

Levels of scale also exist in people-space. From smallest to largest:

Note that the centers on this list don’t form a strict hierarchy, but a DAG: e.g. the people on a cross-functional team come from different departments. In today’s distributed world, a team probably spans offices, too.