VII.1 Reuse

子日,述而不作,信而好古,窃比于我老彭. – 论语 七:一

The Master said, ‘I transmit but do not innovate; I am truthful in what I say and devoted to antiquity. I venture to compare myself to your Old P’eng.’ – Analects VII.1 (Lau)

Before contemplating the process implications of this radically static statement, let’s note that from the perspective of designed code itself, it is always true. Code transforms and transmits information. This is the garbage-in garbage-out principle. Designed code (not genetic or evolved code) does not innovate.

Backups of the user directory for the Analects’ source control repository are, alas, lost to antiquity, and though many sophisticated data recovery techniques have been tried, with some success, none have yielded the identity of Old P’eng. Our ignorance of him highlights our relationship with Confucius and with any classical tradition. To us, Confucius founded a philosophical school, but in his own words he merely continued a tradition that we can see indirectly, if at all.

Scholarly consensus is that Confucius is deliberately overstating his lack of innovation for reasons of rhetoric or modesty (see eg DC Lau, AC Graham, or just wikipedia on this verse). Nevertheless the verse is considered pivotal in understanding Confucius’ traditionalism and conservatism in a time of extraordinary violence and social change.

Existing solutions are useful in at least two ways. 

Firstly they may capture unintuitive theoretical results in accessible ways. Many algorithm design and data structure results are now in this category, such as sorting algorithms and efficient concurrent maps (eg the Java 6 lock free implementation of java.util.ConcurrentHashMap). The formal scientific characterization of such solutions in terms of, say, algorithmic complexity and performance benchmarks  make computer theoretic literacy crucial. Programmers will be unlikely to understand the derivation by reading the code, so they must be able to read the documentation. 

Secondly they may capture highly specific details of the environment and robust solutions to managing it. This will include successful workarounds for under-specified elements of protocols, or flat-out incorrect but popular implementations. Any user of say Ruby on Rails or Tomcat takes advantage of this kind of reuse. Consider too the domain specific details and tolerances of a fly-by-wire control system for a particular make and model of plane.

These two kinds of reuse may be contrived to lie on a spectrum, but I’ve chosen to distinguish them here for their correspondence to two different categories of knowledge – logos and metis. In classical Greek epistemology logos is theoretic universal knowledge and metis is hard won cunning, “feel”, or craft knowledge (as an aspect of techne, craft knowledge and theory). James C. Scott describes the Greek hero Odysseus, surgeons and maritime pilots as all relying on metis (Seeing Like A State). Scott also makes the connection between traditional knowledge – which is particular and tied to a society and geography – and common law conservatism in the tradition of Edmund Burke and Michael Oakeshott.

Confucius is claimed as a kind of Burkean conservative, for instance, by James Kalb. Both Confucius and Burke grew up in societies with small literate elites and large impoverished peasantries. They both share senses of the worth of settled convention, the importance of teaching and the literary canon, a paternalistic affection for heredity power, and a sympathy for the welfare of everyday people.  Neither are they reactionaries, but welcome improvement at a humane pace (IX.3).

Seeing Burke and Confucius as similar is not mainstream and deserves a dedicated analysis of its own. (My searches revealed more extant work linking both of them individually to Wittgenstein than to each other, but pointers are always welcome.) In a comprehensive entry for Burke in the Stanford Encyclopedia of Philosophy, Ian Harris argues that despite being more often claimed by the right wing, he does not have a clear modern partisan successor. Nevertheless, distinguished scholars like DC Lau or AC Graham stay well clear of Western political comparisons, while happily comparing classical Chinese figures with Western philosophers. 

Unusually, a software library, and all the hard won craft knowledge that comes with it, can be imported into another with extraordinary ease when compared to other forms of craft knowledge. A pilot is of little advantage outside his home port, and Ruby on Rails is of little use for 3D rendering, but in software we can copy the pilot and use him on innumerable ships entering that port. We can also ultimately read the source code to Ruby on Rails and determine how it tolerates the idiosyncrasies of particular browsers and servers. This is because all code is built on a formal information substrate – the computational medium. (This is Harrison Ainsworth’s term and his note on reuse provided a number of the connections in this post.)

Not all craft knowledge of a codebase is encapsulated in the codebase. There are particularities of the install, workaround scripts, configuration, scheduled jobs and so on, but these are ultimately digital artifacts easily included within a slightly broader view of what a codebase is (this latter is a premise of DevOps and for anyone serious about a controlled environment). More problematically, there are conventions of use, design choices, oral traditions of “check here when you change there”, and so on. At the limit, all codebases are incomplete. They depend on co-texts, results and knowledge of the domain that need not be encoded. An air traffic control system does not need a textbook description of Bernoulli’s Principle.

Burke and Scott argue that in an established society important, non-obvious, traditional knowledge is captured in social conventions and established practice, and the practice cannot be simplified without a loss of valuable situational knowledge. Scott additionally points out that such an environment is very difficult for an outsider to navigate and there are strong motivations for central political power to apply simplifications to it.

Yet highly particular, ‘local’ code that requires hands on experience and knowledge of accompanying conventions most frequently has another name in software development: bad. Or: spaghetti. Or: legacy. The sentiment is well captured in Qi’s koan on fear, even if it does riff off an opposing classical Chinese tradition. (In Confucian terms we might note the building is not harmonious.)

In No Silver Bullet, Brooks distinguishes accidental and inherent complexity, with the latter being an attribute of the underlying problem rather than any specific software or hardware implementation. Complexity due to poor or improvable design is always accidental; that due to the problem domain is by definition inherent.

An aesthetic sense of good or poor design becomes crucial when pursuing aggressive reuse (VII.14). Without it you will simply perpetuate junk.

Having argued the link between conservatism and software reuse, it is worth being a little more precise about flavours of conservatism. William F. Buckley famously described it as that which “stands athwart history, yelling Stop, at a time when no one is inclined to do so, or to have much patience with those who so urge it.” Despite its partisan origins, this is a good start, as it illustrates certain threads of environmentalism and the idea of heritage listing fall easily under the same banner. ((It is also useful to think of contemporary US Democrats defending Franklin D. Roosevelt’s New Deal, or opposition to changes to Britain’s NHS in this frame.))

In its purest form, this can be “return to a golden age” conservatism. There’s certainly an argument that Confucius would have been happy with a reversion to the society of the Eastern Zhou. We should again temper our interpretation by wondering how much is rhetoric covering adaptation of tradition to new times. In software, certainly, simply reactionary approaches are of little use. Brooks and the founders of eXtreme Programming have both noted that a more effective strategy is to embrace change. Oakeshott argues in On Being Conservative that settings of widespread and enthusiastic change are in particular need of an awareness of the value of what exists now. A traditionalist most often defends the present versus the future, not the past versus the present. This conservative disposition’s usefulness to software is more apparent if taken as an analytic tool rather than an inherent aspect of personality. After all, the greenfield doesn’t exist (see X.18), and any project that pretends to be a greenfield is an interesting lie.

Conservative thought in this vein usually emphasizes working within a tradition and a community – in software we would say platform. This also suggests interesting contours for the breadth of possible reuse; and there are other verses, such as XVI.11, where that might be explored. What is immediately apparent is the narrowness and fragility of an entirely in-house platform due to the smallness of its developer community; and the need for a shared jargon (XIII.3) and perhaps a canon (XVI.13).

Given the corpus of extant code in the form of libraries, to adore antiquity is to know your platform, including its innards, not just thoughtless rote quoting via copy and paste. At this moment in software, to reuse and extend is a greater service than extraneous self-involvement masquerading as innovation.

If you can easily find some code and copy it, you get the result at zero cost. That is an efficiency that cannot be beaten: no amount of programming tool and technique improvements can ever do that. So we want to maximise reuse. – Fred Brooks, No Silver Bullet

The Vengeful Angels Of Our Nature

It’s not surprising, in a movie such as Abraham Lincoln: Vampire Hunter, to find a great deal of hunting vampires, but I did find rather more than I expected of Mr Lincoln. Part of the point of such a piece is of course the glorious joke of its title. Given the basic setup is pretty much explained before reaching the cinema, even more so for those who saw the earlier novel, the challenge is to put something else behind it.

Critics have come out uniformly negative, like a line of Union soliders wielding Springfield rifles of hate. Actually, Timur Bekmambetov and writer Seth Grahame-Smith don’t do too bad a job. Abe: VH has its problems. It doesn’t take the approach (I would think a mistake) of being just a fight movie in 1860s costume. The second act even takes time out for political exposition and smaller scale Whitehouse family drama; a saggy but welcome variation from a simple progression of action scenes. It’s an action movie that makes time for the Gettysburg address. It’s not a long speech, but somehow a little more than expected.

Some parts are flawed. Others are freaking awesome. They are freaking awesome in the same way as Brad Nelly’s George Washington.  They combine mythic fragments of the American Civic Religion with mythic fragments of American action movies and mythic fragments of vampire lore in a mosaic that celebrates their symbolic role while signalling it is also a fiction.

Bekmambetov and Grahame-Smith play the material straight. Again I think this is the right choice when presenting such a flagrant counterfactual. Winking at the content would destroy the premise of the fantastic world. The viewer can always step back to laugh at the absurdity of the hook; they shouldn’t be pushed back. There are some good fights, much influenced by the post-Matrix martial arts style. At 105 minutes it doesn’t overstay its welcome.

American presidents have a role not unlike saints or Hellenic gods in the American Civic Religion. And many-named Lincoln is at the heart of the pantheon, equal to the founding fathers in symbolic weight, the great hinge on which the chronology of American statecraft swings. Lincoln even sounds mythic. He had, in Adam Gopnik’s words, “mastered the sound of the King James Bible so completely that he could recast abstract issues of constitutional law in Biblical terms, making the proposition that Texas and New Hampshire should be forever bound by a single post office sound like something right out of Genesis”.

This movie’s Lincoln is not the Lincoln of history books, though the complexity of the man lends him weight as an action hero. Don’t all politicians have secret lives run in parallel with their very public lives? This story reverses the usual superheroic trope – the secret life is the one of clean hits and unambiguous moral purpose. The famous, public life is the compromised one beset by moral quandaries. (Batman is a variation where both identities are famous.)

How much of the real Lincoln is really told by popular history? The Lincoln of this movie doesn’t say anything like those dismaying words of the First Inaugral,

I have no purpose, directly or indirectly, to interfere with the institution of slavery in the States where it exists. I believe I have no lawful right to do so, and I have no inclination to do so.

… and yet, how often does that enter the foreground in the history of poular memory? Lincoln is the great American nationalist, and the great liberal imperialist too. I view this from a non-American vantage point, so maybe I’m missing some cultural context. Maybe all elementary schools tease out the multifarious economic, demographic and historic causes of the War between the States and all Fourth of July barbeques are accompanied by nuanced discussion of the political factions faced by the 16th president.  Many Americans do know their own history well.

I suspect that even when the history is well known the myths of civic religion require certain narrative simplifications. Conor Cruise O’Brien argues much the same about Jefferson. (Jefferson para-scholarship is also largely silent on whether he was a vampire.) The virtue of a movie like this is acknowledging that mythic need while separating it somewhat from history. Grahame-Smith even constructs a scene where Pickett’s charge makes sense – vampires need not fear bullets and can infiltrate an enemy line with invisibility. It’s far more rational than the psychology of armies and generals failing to learn new tactics in the face of new tech.

Civic religions are worthwhile when they support worthwhile ideals. The American variant supports liberty and democracy and a system that for all its flaws is the great exponent of the same. They let us make the transformation from merely thinking republican democracy is a good idea and truly believing it.

Maybe it’s for the best that in these days of targeted US drone assassinations a movie imagining a president individually killing evildoers with a silver coated axe has not swept all before it. When I put it next to such monumental pieces of kitsch as Harrison Ford’s Air Force One or Mt Rushmore it hardly seems out of character. At least Abraham Lincoln: Vampire Hunter is honest about what it confabulates.

Making A Few Enemies

That idea of the state as a ship and its ruler as the helmsman or captain is a very old one in European culture. It is frequently used by Cicero, and indeed our word ‘governor’ comes from the Latin for ‘helmsman’ – gubernator. Even more enticingly, the root of gubernator is the Greek kubernetes, which is also the origin of our word ‘cybernetics’; so the notions of ruling, steering and robotics all coincide in our language – and in this galleon.
[…]
Observers repeatedly stressed the precision, the orderliness, the grace of mechanisms like this one, which embodied the ideal of the early modern European state as it ought to have been and rarely was, with everything working together harmoniously under the control of one guiding idea and one beneficent sovereign. Its appeal went far beyond Europe: automata like our galleon were presented as gifts to the emperor of China and the Ottoman sultan and were greatly prized. What ruler, from Dresden to Kyoto, would not gaze in delight as figures moved to his command in strict and unswerving order? So unlike the messiness of the real world.
— Neil MacGregor, A History of the World in 100 Objects; corresponding entry at the BBC

Attractive as it is, it’s not really a great metaphor for a state, or even politics at all, is it? There’s no divergent interests, no arguing or lobbying, no betrayal, assassination and backstabbing, and as a result, no trust, no faith no opinion: just harmonious movement. And if it seems naive, now that we carry more sophisticated automata around in our pockets, I don’t think it’s any less seductive. This is essentially how Sid Meier’s Civilization and all its throwoffs work – you have absolute power to push the buttons and pull the levers of not just a state, but an entire Samuel Huntingdon-grade civilization.

The Crusader Kings series shows one way to turn that on its side, with the key mechanic beng to have the player control a dynasty, rather than a state. (Entertaining Rock, Paper, Shotgun review and interview.) The offices and trappings of the state are then resources to be fought over, prestige is a currency like money, and organizing weddings and sending gifts become important game tokens rather than flavour. This is not to discount the wealth of historical detail the makers then hang on that frame; the mechanic makes the game compelling, the detail is what makes it feel right. In a way, the makers have made all the state diplomacy an extension of domestic political squabbling, and that dissolving of the facade of corporate consensus seems bang on, especially for the European middle ages. Its easier to understand Richard the Lionheart if you see him as pursuing dynastic interests on both sides of the English channel than as chief executive of the Eternal Albion. (Echoes of Coase’s The Nature of the Firm here too: companies aren’t monolothic either.)

The original Crusader Kings was released the same year as Facebook launched, in 2004, and the chosen model for the dynastic game mechanic is a social network between thousands of European aristocrats. As much as possible, the developers use historical figures, and even link to their biography on wikipedia. The CKII user interface is definitely influenced by social networks as well, with it being simple to navigate between photos of related individuals. I almost wish they’d taken it further. A history of viewable actions by a character would look rather like the stream of activity on a facebook wall, after all.

Now we have orderly (and brittle) automata as routine tools in our lives, we use them to simulate the messiness of the Holy Roman Empire for kicks. So keeping in mind that The Social Graph Is Neither, a messy network of individuals and competing dynastic interests is a rather more satisfying model of a state to my twenty-first century sensibility. Rather than a ship, perhaps a fleet of nautical automata, all with different captains, would be more suitable: that’s what the Internet is, after all.

VII.14 The joys of music

子在齐闻韶,三月不知肉味,日,不图为乐之至于斯也。– 论语,七:十四

The Master heard the shao in Ch’i and for three months did not notice the taste of the meat he ate. He said, ‘I never dreamt that the joys of music could reach such heights.’ — Analects VII.14 (Lau)

When Ataturk said “There is no revolution without music,” he had a very specific type of music in mind. The founder of modern Turkey had already brought and led the country through extraordinary change, from wars through ways to dress through the structure of government. At least in Andrew Mango’s interpretation, adoption of the European classical music tradition could then stand as a culmination of that national modernization, a sign that Turkey had arrived.

For Confucius, too, music had moral and political weight as well as aesthetic. Harmony was of great importance to him as a political theorist and as a system designer. Different components work together in harmonious co-operation in a well-built system. Confucius saw a well-functioning state working the same way: for example in XII.11, when everyone from the ruler on knows their place in the system, they can work together.

Carol Michaelson and Neil Macgregor link Confucius’ sense of harmony with the grand bronze ceremonial bells of the Spring and Autumn Period 春秋时代. These were large, expensive, technically sophisticated objects, only within the reach of a lord of a state. We can even imagine this institutional sound being the rather austere music Confucius so enjoyed, though it could have equally been zithers and pan pipes on a more intimate scale.

It’s a very personal, visceral, human reaction captured here, with senses overwhelmed by an aesthetic experience. It shows this reaction to the harmony of a system – a system of instruments in this case – as an intuitive one. It’s also a refined sense. Confucius is, amongst other things, a music critic and a censor, as in XV.11, where he says “Banish the tunes of Cheng” 放郑声远.

This intuitive, trained, sense of how a system is assembled is of great value to a software developer. Kent Beck used the term Code Smell to refer to the sense something could be improved in a piece of software, based on a relatively short aquaintance with the code. Confucians have an auditory metaphor, rather than an olfactory one, but the idea of aesthetic cues for system building coming from non-conscious sources is the same. Code smells focus on the dischordant elements. Conversely, code can sing. The fix is in, everything compiles without warnings, the unit tests and acceptance tests are green, you deploy and run cleanly in production; the joys of software can reach such heights.

[B]elatedly we need to tell you that the musical ensemble would have been a happier mataphor[.] — DeMarco and Lister, Peopleware

Nostromos of Nanyang

All history is political, and all history is suffused with a sense of loss. 兰芳记, The Chronicles of Lanfang, sifts through both. Working with a team of writers and performers, director Choy Ka Fai brings into being a speculative museum of the Republic of Lanfang (兰芳公司), an 18th-19th century Hakka Chinese settlement in what is now Indonesian Borneo. The piece can be explored as a museum site alone, and there are also performed tours of the museum.

The Lanfang Republic was a real place, and there is a serious argument to consider it a small state with a population of tens or hundreds of thousands of people, depending on the time, and how you count. (For example, the wikipedia page points out only ethnic Chinese had voting rights in presidential elections. Without disputing major race discrimination was going on, the territory of the republic was probably not clearly controlled at borders in the modern sense, either.) The settlement existed because of, and the economy was dominated by, a nearby gold mine. It’s a fascinating moment in time, and the musuem setup includes archival material and books like Yuan Bingling’s intriguingly titled Chinese Democracies for those that want to follow up further.

The exhibits, and the performances, hold up artifacts to the light for us to see. This ranges from historical, to speculative, to impossible-but-thematic. A photo of a Chinese merchants Dayak wife, and her son; with a note that Dayak women were bought with a dowry. As well as conventional monogamy and traditional multi-wife polygamy, the massive gender disparity on the gold fields also spawned other relationships: like multiple miners pooling their funds to match the scarce erotic capital of a single Dayak wife, who would be free to sleep with other men or buy her way out of the marriage.

The speculative De Groot Collection organizes reconstructed artifacts into a museum tour. The curator/actor relates a timeline around the artifacts linking it to more familiar events in consensus history like the Napoleonic Wars or the abdication of Qianlong 乾隆帝. There’s a beautiful momentum to Ng Yi-sheng’s speech, though the inclusion of Luo Fang Bo’s mythical crocodile harnesses in the collection derailed it slightly for me. Choy Ka Fai is interested in obscured history, he tells us in the performance prologue, but undersignalled mythology obscures it further.

The short documentaries, The Man Who Rode Crocodiles, and Insignificant Landscapes, are meditations on emptiness and ruin, using locations tied to the republic. This whole piece isn’t just about the history, or else it would be a museum exhibit. The films are more about showing an absence, which is harder than it sounds.

A small number of artifacts, like the banknote at the top of the post, are from a parallel present that never existed. I have a weakness for these. They taunt me to see if I can pay with Luofang yuan (LFY) when booking tickets for the upcoming test match between the Confederate States of America and the Republic of Kashmir.

Parts of this piece have been staged once before at the Singapore Art Musuem, but it is sited now at the Ying Fo Fui Kun Cemetry 应和会馆墓. It’s an evocative place, founded by Hakka from the same Chinese prefecture as those that founded Lanfang Kongsi, three years later. Two short solo performances make a great theatrical use of the space. Epic Poems of the Kongsi War, in the form of a Malay family history, has a particular strength. The explicit performances give the actors the freedom to use full hysterical throttle as required. For the more curatorial pieces, it’s harder to strike the appropriate tone. This isn’t Banksy upending institutional hypocrisy with postmodern untruth, after all, unless I’ve misread the intent entirely. To reveal obscured history, I wonder if it might have been simpler to get a grad student from one of the local history departments involved as a guide, if harder to coach for a broad audience.

These are minor points. I spent the afternoon exploring the remnants of a republic founded a year after the United States declared independence, with the population of classical Athens, that lasted for a hundred years, but was convenient for people to forget. The study of the classics, Mary Beard recently wrote, is the study of what happens in the gap between antiquity and ourselves. Sometimes antiquity happens very quickly.