Sunday, February 18, 2007

A Program is not a City



Christopher Alexander argues in “A City is not a Tree” that cities that have grown over the years, “natural cities” like Kyoto, London, and Manhattan, are definably more complex than planned cities, like Chandigarh, Brasilia, and the British New Towns. [I found this article via Scott Rosenberg’s recent book Dreaming in Code.]

According to Alexander, planned cities are “trees,” mathematically speaking, and natural cities are “semi-lattices.” Semi-lattices contain overlapping units; “trees” and planned cities, do not. For example, the center of Paolo Soleri’s Mesa City (illustrated in the article) is divided into a university and a residential quarter, which is itself divided into a number of villages, each again subdivided further and surrounded by groups of still smaller dwelling units. Semi-lattices are more complex than trees:
“We may see just how much more complex a semi-lattice can be than a tree in the following fact: a tree based on 20 elements can contain at most 19 further subsets of the 20, while a semi-lattice based on the same 20 elements can contain more than 1,000,000 different subsets.”
Alexander’s claim is not entirely convincing – for example, he never shows that natural cities are semi-lattices – but I’m persuaded that the organic old cities we love are more complex than ones that spring fully formed from the head of an architect.

There are often disconnects between what we can recognize as good, and what we can make ourselves. Most people can appreciate skillful violin playing, but can’t do it themselves. Natural cities demonstrate that we can, collectively and over time, produce semi-lattice artifacts. (I’ve claimed that social processes are a way of dealing with problems that are to big to fit into individual brains.) Natural cities just feel right, but when even the greatest minds design a city, they resort to nested hierarchies: a tree structure. Perhaps humans can’t, through conscious intellectual effort, make a persuasive structure with a semi-lattice’s overlapping intricacy.

The cognitive capacity limitations of individual brains may mean that we can’t keep track of enough units concurrently to make generate complexity. Given the limitations on single brains, we have to use simpler rules, like trees, with less satisfactory but more controlled results. This may be why hierarchies are so deeply embedded in software:
“A city may not be a tree, as Alexander said, but nearly every computer program today really is a tree – a hierarchical structure of lines of code. You find trees everywhere in the software world – from the ubiquitous folder trees found in the left-hand pane of so many program’s [sic] user interfaces to the deep organization of file systems and databases to the very system by which developers manage the code they write.” [Scott Rosenberg, Dreaming in Code, p. 185.]
Simple rules can sometimes yield complex results, which is why fractals fascinate us. But while the Mandelbrot set might be pretty, it doesn’t speak to the heart in the way that a great city does. We can see that our minds and machines are inadequate, but we can’t as a matter of individual effort do what is required, which is (if Alexander’s right) to conjure semi-lattices. [1]

Complexity isn’t always attractive. Simplicity is appealing when it is important to understand something, that is, when we need to fit something inside our brain. Richard Stiennon made a powerful case that Windows is harder to secure than Linux by showing two pictures. The economy (and tree-like structure) of the Linux call diagram argues strongly that it is a more intelligible, and thus more easily securable, system.


-------------

[1] There seems to be a connection with the P =? NP problem which, loosely stated, asks if is always easier to demonstrate that a given solution is correct, than to find it. Many (most?) computer scientists think that P≠NP. The intuitive rightness of this unproven conjecture resonates with the fact that so often we can appreciate a thing of beauty, but can’t make it ourselves.

No comments: