Skip to content

For the Love of Law

The law is the source code of the state, and it's overdue a refactor.

Share
Mosaic of Emperor Justinian and his retinue, Basilica of San Vitale, Ravenna
Justinian and his retinue, Basilica of San Vitale, Ravenna, c. 547. The empire in the picture didn't last. (Photo: Carole Raddato, CC BY-SA 2.0)

In 528, the second year of his reign, the emperor Justinian looked at Roman law and saw a system on the edge of collapse. Not the courts, not the lawyers, not the empire itself, though all of those had their problems. The law. The actual corpus of it: a thousand years of statutes, imperial pronouncements and juristic opinion, layered since the Twelve Tables, much of it contradictory, most of it inaccessible, some of it lost except by reputation. Rome had the most sophisticated legal tradition on earth, and almost nobody, including the people paid to apply it, could say what the law actually was.

So he did something no ruler had seriously attempted. He appointed a commission and told it to read everything, keep what worked, cut what didn't, resolve the contradictions, and publish the result as the single authoritative statement of Roman law. The first Codex took fourteen months. Then came the truly mad part: the Digest, an attempt to distil the entire literature of classical Roman jurisprudence into one work. By Justinian's own count, his commissioners read close to two thousand books, some three million lines, and reduced them to a hundred and fifty thousand. He gave them ten years. Tribonian and his sixteen jurists did it in three, and the method was pure engineering: the literature split into three masses, three subcommittees reading in parallel, merging title by title, the known conflicts settled by imperial ruling before the reading began. They sharded the corpus.

On the bookshelf beside my desk sits the third pillar of that project: the Institutes of Justinian, Moyle's translation, fifth edition, Oxford.

A hand holding the Institutes of Justinian, translated by J. B. Moyle, fifth edition, Oxford, dark blue cloth binding with gilt spine
The entire foundation of Roman legal education. It fits in one hand.

The Institutes was the official first-year textbook of the restored law, addressed by the emperor himself to "the youth desirous of studying the law", and the thing that strikes me every time I take it down is how slim it is. The entry point to the mightiest legal system on earth, deliberately compressed into a volume you can read in a weekend. We use "byzantine" as a byword for administrative sprawl, and the actual Byzantines, at their best, produced concision as a matter of imperial policy.

The Prooemium page of Moyle's translation of the Institutes, beginning: The imperial majesty should be armed with laws as well as glorified with arms
The Prooemium. 'The imperial majesty should be armed with laws as well as glorified with arms.'

I think about this project more than is probably healthy, because it is the largest refactoring exercise of the pre-digital world, and because I have spent the last two years of my working life on its modern descendant. This post is my attempt to say why, plainly, so I can point at it later. Call it a mission statement.


Governing by Séance

One law shows how bad things had become.

A century earlier, in 426, the imperial government faced a practical problem. Roman law wasn't primarily statute; it was jurisprudence, the accumulated opinions of centuries of legal scholars, and those scholars disagreed. A judge might find three authorities pointing three different ways, with no principled means of choosing. The solution was the Law of Citations. It named five dead jurists, Papinian, Paulus, Ulpian, Modestinus and Gaius, as the canonical authorities, and instructed judges to resolve conflicts by counting votes among them. Majority wins. In a tie, Papinian prevails. If Papinian is silent, the judge may finally, reluctantly, think for himself.

Five imagined portraits side by side: marble relief of Papinian, mediaeval woodcut of Paulus, statue of Ulpian in Tyre, statue of Modestinus in Rome, marble relief of Gaius
The five, as later centuries imagined them. No portrait of any survives. These are the ghosts Rome voted with. (Images: Wikimedia Commons; photos CC BY-SA)

Rome could no longer reason about its own law. It could only count votes among ghosts. When law outgrows comprehension, governance becomes a séance.

I'd find it funnier if I didn't recognise it. Every mature legal system drifts towards its own Law of Citations: guidance interpreting regulation interpreting statute, until the law exceeds the working memory of the institutions that run it. England found out in 2008, in a smuggling appeal called Chambers: the regulations everyone was arguing over had been dead for seven years, and the Court of Appeal was about to hand down judgment on them when a prosecution lawyer noticed, by chance, the day before. "So effectively it was a fortunate accident?" the judge asked. "My Lord, I regret to say it was a fortunate accident." The state was prosecuting its citizens under a ghost.

And the cost falls on the governed: the tenant who cannot learn what her landlord may lawfully demand, the small business that cannot discover what compliance means without paying someone to translate. Law the governed cannot find has stopped being a public good and become a professional secret. The deeper cost is the fights that never start: people weigh their cause against the sediment of layered law, price the fight, and fold. Break that asymmetry and you arm the citizen, and the honest lawyer too, whose hours go on arguing the law instead of excavating it.

Legislative Debt

Software engineering has a name for this condition. Ward Cunningham coined it in 1992: technical debt. Every patch shipped without cleaning up the code around it incurs a debt, the debt charges interest, and the interest is paid in every future change being slower, riskier and dearer, until the cheapest option is the one nobody wants to fund: stop, read everything, restructure.

Statute books accumulate debt the same way, and for the same reasons. Legislating is patching. A new act rarely replaces the old law cleanly; it amends it, cross-refers to it, carves exceptions into it, and leaves repealed fragments lying around like dead code. And nobody prunes, because every government arrives with a programme and a clock, and refactoring wins no votes.

So the interest compounds: in compliance costs, in the months lawyers add to every infrastructure project, and in the quiet corruption that thrives wherever ambiguity does. A loophole is just a bug that someone has learned to exploit. Tacitus named the pattern two thousand years ago: the more corrupt the state, the more numerous its laws. He had the causation half right. It runs both ways.

Software has version control, compilers, test suites, diffs. Law, the source code of the state, has PDF: a photograph of a document, legible to a patient human and to nothing else. You cannot diff a photograph, query it, or test an amendment against it. A country negotiating accession to the European Union must reconcile its entire statute book, provision by provision, with a legal order of thousands of acts. Today that is done substantially by hand, by small teams of heroic officials, reading PDFs.

Meme: the vast bow of the Ever Given container ship labelled 'legislative debt' towers over a tiny excavator labelled 'two civil servants and a PDF'
The remediation plan.

That is legislative debt, and the West carries more of it than at any point in its history. There is an anxious discourse about why rich democracies struggle to build: houses, railways, grids, reactors. The explanations are many and I don't pretend this is the only one. But some real fraction of the paralysis is that we have lost the ability to see our own rules. You cannot move fast through a system you cannot read.

Not the Chainsaw

At this point a certain kind of reader is nodding along for the wrong reasons, so let me be precise about what I am not arguing.

The fashionable response to regulatory sclerosis is demolition: the bonfire of red tape, the chainsaw, the pledge to delete ten rules for every new one. I understand the impulse and I don't share the programme. The premise of the chainsaw is that the problem with law is its quantity. The premise of this essay is that the problem is its legibility. Those sound adjacent and they are not. A small, opaque statute book is worse than a large, legible one; ask anyone who has lived under a regime where the law is short because the real rules are unwritten.

And the demolitionists skip a step: you cannot deregulate what you cannot read. To repeal a rule you must find it and trace every provision that leans on it. Done by hand, across a whole statute book, that work outlasts any government that starts it. So ministers patch instead of prune, reform shrinks to what can be mapped before the next reshuffle, and the debt grows. Illegibility is not a symptom of the debt. It is the debt's defence.

There is a subtler defence: that the ambiguity is deliberate. Parliaments write vague words to hold coalitions together, and to let courts settle cases nobody foresaw. True. But it confuses two kinds of vagueness. When a law says "reasonable", it appoints a judge: a court will decide what reasonable means, in public, with reasons given. That is a standard, and it is delegation. A loophole appoints nobody. Two clauses contradict, a discretion goes undefined, and no court will ever be asked. That is abdication, and abdicated ground is where corruption digs in.

A Ukrainian legislator gave me the image I cannot improve on: metal without paint will rust. Paint does not change the shape of the metal; it seals it. Consolidation, likewise, does not strip law of its human give, its standards and its judgment calls. It closes the corrosion sites nobody meant to leave open. Ambiguity is human, and so is corruption, but not all that is human in law is corruption.

The bill for all this arrives at the courts. England's Crown Court backlog stands at a record eighty thousand cases; the magistrates' queue is nearly four hundred thousand. The response is always supply-side: more judges, more sitting days, more courtrooms. The demand-side question goes unasked: how much of the docket is manufactured by the law itself, the contradiction that takes a hearing to resolve, the discretion that takes a judicial review to define? Litigation is the runtime cost of ambiguity. Engineers profile slow code before they buy faster hardware; law has analytics too, but they serve litigators, not lawmakers. No government treats its caseload as telemetry on its own statute book, finds the clauses that produce the disputes, and optimises accordingly.

Dog Law and Living Law

If this essay has a patron saint besides Justinian, it is Jeremy Bentham: the English philosopher who founded utilitarianism and spent a long life demanding the rational reform of everything from prisons to parliaments. His preserved body still sits in a case at UCL, attending, by cheerful college legend, the occasional meeting as "present but not voting". Bentham's charge against English law was not that it was wrong but that it was unknowable. Law that citizens discover only by being punished under it he called dog law: you don't tell the dog the rule in advance, you wait until it transgresses, then beat it. "This is the way you make laws for your dog," he wrote, "and this is the way the judges make law for you and me." It is the oldest complaint in Western law. The Twelve Tables, the bottom layer of Justinian's inheritance, exist because Roman plebeians refused to be ruled by laws only the priests could recite, and forced them onto tablets in the Forum for anyone to read. Bentham was making the same demand, two millennia on. His remedy was the complete restatement of the law in one written, public, rational text, a project he believed in so totally that in 1811 he wrote to President Madison offering to do it for the United States personally. Madison, to history's loss, declined. And because no word existed for the activity, Bentham invented one: codification.

Portrait of Jeremy Bentham in old age, seated, by Henry William Pickersgill
Jeremy Bentham, by Henry William Pickersgill, c. 1829. National Portrait Gallery, London.

I share Bentham's codification instinct. But he is a favourite radical, not an oracle, and here we part company: Bentham wanted the common law abolished outright, replaced by his rational code. As an Englishman, I politely decline. The common law is one of humanity's great emergent systems: a constitution that evolves, correcting itself case by case, absorbing new realities without waiting for a legislature to notice them.

The office of Prime Minister is the perfect specimen. No law created it. The title began as an insult, flung at Robert Walpole for hoarding more of the king's business than any one minister decently should, and Walpole denied it flatly: "I unequivocally deny that I am sole and prime minister." The office he was denying went on to run the country for a century and a half before any official document admitted it existed. To this day the brass plate on the door of Number 10 says First Lord of the Treasury. Britain's most powerful office was never designed. It emerged, over everyone's denials, and the constitution grew around it.

The alternative is on display elsewhere: a text frozen at its founding, where every living political question becomes archaeology and the guardian court becomes a second, unelected legislature. An emergent constitution can still learn.

Bentham's real demand was never the abolition of precedent. It was knowability, and in 1811, rewriting the law as one text was the only technology that could deliver it. We have another. Digitise the common law properly, every judgment addressable, every citation a link, every principle traceable through the cases that shaped it (the National Archives' Find Case Law service has made a real start), and the emergent system becomes as transparent as any code without losing its capacity to grow. To digitise is to codify. The choice Bentham thought he faced, between evolution and legibility, was an artefact of paper.

Not less law, and not frozen law. Law you can see.

The Next Codex

Justinian's compilation carries an argument in its name. Codex comes from caudex, a tree trunk split into leaves: the bound book, as against the scroll. That was not a change of packaging. A scroll can only be read from one end; a book can be consulted, opened at the exact provision, held apart at two places for comparison. Law seized on the book early and hard, because law, more than any other kind of text, is used by lookup. That is the lesson hiding in the name: change the format, and you change what law can do.

We are overdue the next one. The successor to the codex is not a better document; it is the end of the document as the unit of law. Every act, section and subsection an addressable object. Every citation a resolvable link. Every amendment a recorded transformation, so the statute book at any date can be reconstructed the way version control reconstructs a codebase. None of this is speculative: the standards exist and are open, and a few jurisdictions already publish this way, which is why the United Kingdom's legislation website, built in the years after Chambers embarrassed its courts, feels a generation ahead of most of the world's. The principal standard, fittingly, was not born in Brussels or Washington. Akoma Ntoso began under a United Nations initiative for African parliaments, and its name is Akan for "linked hearts". The field's foundational format is literally named for love. It is where this essay gets its title.

The 1297 exemplification of Magna Carta, dense mediaeval script on parchment with a wax seal
<akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0">
<act name="aep">
  <FRBRdate date="1297-01-01" name="estimated"/>
  <FRBRauthor href="/id/legislature/EnglishParliament"/>
  ...
  <section eId="section-XXIX">
    <num>XXIX</num>
    <heading>Imprisonment, &c. contrary to Law.</heading>
    <content>
      <p>NO Freeman shall be taken or imprisoned, or be
      disseised of his Freehold, or Liberties, or free
      Customs, or be outlawed, or exiled, or any other
      wise destroyed; nor will We not pass upon him,
      nor <ins>condemn him,</ins> but by lawful judgment
      of his Peers, or by the Law of the Land. We will
      sell to no man, we will not deny or defer to any
      man either Justice or Right.</p>
    </content>
  </section>
Magna Carta (1297), clause XXIX, exactly as legislation.gov.uk serves it today: Akoma Ntoso XML, addressable to the clause. The ins element is a tracked amendment to a law now in its eighth century.

The timing has just become urgent, because of what else is arriving. AI systems are already answering legal questions for officials, businesses and citizens, at scale, from whatever they can reach. The stakes scale with the user: a model that misstates the law to a tenant costs her a dispute she deserved to win; one that misstates it to an official drafting guidance writes the error into the state itself. If the law is not machine-readable, these systems answer from approximations of it, fluently and wrongly. If it is, every answer carries a citation and can be checked. We are going to connect machine reasoning to the law either way. The only question is whether we do the engineering first.

This is the work. It is why I spent my years in government building tools to help drafters and officials navigate legislation, and why I now do the same with governments around the world, some of them facing the problem in its most acute form: statute books that must be reconciled, screened and rebuilt at national scale, with teams a fraction of the size the task deserves. The mission does not change with the client: make a country's law accessible and machine-readable, because clear, citable, current law is public infrastructure, as load-bearing as the grid.

I would put the stakes higher still. Everything we now demand of our states, on housing, energy, defence and care, lands on machinery that runs on rules it can no longer read. A state that cannot see its own law cannot know which obligations conflict, which loopholes stand open, or what its own reforms will actually do. Legibility is not tidiness; it is state capacity. On a long enough view it is an instrument of power, and the proof is the ending of Justinian's own story.

The Second Conquest

By any conventional measure, Justinian's reign ended in failure. The reconquest of the western empire, his life's military project, consumed decades and treasure and was substantially undone within a generation of his death. The plague hollowed out his cities. The empire he rebuilt contracted around him. If you had audited Justinian in the year 600, the ledger would have been grim.

Except for the law. In the East, the empire that kept Justinian's code outlasted the one he reconquered by nine centuries, and it did not stay clean by magic. The Latin Digest soon went unread in a Greek-speaking empire, summaries silted up over the text, and the whole refactor had to be run again: a short Greek handbook in 726, then a full re-codification in the 890s that its sponsors called the anakatharsis, the "cleansing of the ancient laws". The debt reaccumulated even over the great paydown. The difference is that Byzantium kept paying it, and the returns compounded: the final compression, six books distilled by a judge in Thessalonica in 1345, was still the working civil law of Greece in 1946.

In the West, the Digest survived, barely: for centuries it vanished, persisting in a single near-complete manuscript, until, at the end of the eleventh century, it was rediscovered and began to be taught at Bologna, where the students gathering around its glossators became the first university in the world. From that one recovered text, Roman law spread back across the continent it had once ruled, carried by graduates who staffed the chanceries and courts of medieval Europe, flowing eventually into the Napoleonic Code and from there into the civil law of most of humanity. Napoleon, who understood the hierarchy perfectly, said his true glory was not his forty battles, which Waterloo would erase, but his Code, which nothing would. Rome conquered Europe twice, the historians' line goes, and the second time it needed no legions. The legions failed. The law held.

The State as a Work of Art

There is a final movement to this story, and it supplies most of my motivation.

The rediscovered law refilled more than courtrooms. Bologna's graduates staffed the chanceries of Italy, and by the fifteenth century something new had appeared there, which the historian Jacob Burckhardt named better than anyone since: the state as a work of art. The Italian states, he argued, were the first in Europe to be treated as made things, the outcome of reflection and calculation. He meant it with a shudder as much as admiration, since many of the makers were despots. But strip out the cynicism and keep the craft, and you have the idea that changed everything: a state is not inherited weather. It is an artefact. It was designed, which means it can be designed better, which means it is a proper object of ambition and of care.

Ambrogio Lorenzetti's fresco The Effects of Good Government in the City: a prosperous mediaeval Siena, dancers in the street, builders at work
Ambrogio Lorenzetti's fresco The Effects of Bad Government in the City: a ruined Siena, buildings crumbling, soldiers in the streets, a body left lying
Good governmentBad government
Ambrogio Lorenzetti, The Effects of Good and Bad Government on the City, Sala dei Nove, Siena, 1338–39. Painted on the walls of the room where the Nine governed.

The historian who has most reshaped how I read that period is Ada Palmer, whose Inventing the Renaissance dismantles the golden-age myth with visible glee. Her Renaissance is desperate: plague-ridden, war-torn, a Europe that reached back to a lost Roman Empire because it was drowning, not because it was flourishing. I find that reading more inspiring, not less. The Renaissance was not a golden age that happened to people. It was a project undertaken by frightened people who decided their world could be better and went looking in the ruins for tools, which is exactly the posture this essay recommends. Palmer's own verdict doubles as mine: "We can do better than the Renaissance."

Government should be better. Not smaller as an end in itself, not louder: better made. And a citizen does not experience "better made" as XML schemas or version-controlled statutes. They experience what the craft makes possible: a business started in minutes rather than months, justice that arrives while it still matters, prices without a hidden compliance rent, a rulebook they can read before they are punished under it. A fair economy and fair justice sit downstream of legible law the way the Renaissance sat downstream of rediscovered order. The medieval condition is to endure the complexity you were born into. The renaissance begins when someone decides it can be understood, restated and improved, and picks up the tools.

I know what it looks like when a country concludes the structure cannot be improved. I was two days too young to vote in the referendum of 2016. Much of my family, in the north of England, voted to leave, and I understood the vote then and understand it better now. The vote had many causes, and the legibility of law was not high among them. But the shape it took is the tell: when people cannot see the rules that bind them, they cannot reform them, and the only legible act of reform left is demolition. The window opened, and what came through was the chainsaw, because the chainsaw was the only tool anyone could describe. Refactoring was never on the table; the corpus was online for anyone to read, and beyond anyone's comprehension. When the government afterwards tried simply to count the EU-derived laws on its books, it found 2,400. The count now stands at almost 7,000, and it is still growing.

Meanwhile the pattern generalises. The backlash against globalisation is wrapping each nation in fresh layers of legal insulation, and divergence is debt squared: every rulebook that splits from another doubles the reconciliation someone must someday do. The answer is not to canonise any settlement as final; it is to keep the law a living draft under version control. Machiavelli, the Renaissance's coldest reader of states, thought republics endure only by being drawn back, again and again, to their first principles. A state's first principles live in its law, and no state can return to what it cannot read.

We all say we want less red tape; whether we will staff and fund the work behind it is another question. I think the dissatisfaction is assembling that mandate, but mandates like this one do not arrive on schedule. They arrive in windows, after shocks: Napoleon codified after a revolution, the Germans after unification, and Justinian's commission worked through riots that nearly burned Constantinople around it. Britain shows what happens when a window opens onto a corpus nobody can comprehend. More windows are coming. The countries that benefit will be the ones whose statute books are already structured, already readable, when the moment arrives, just as Tribonian beat a ten-year deadline because the reading had already begun. You cannot choose the moment. You can be ready for it.

We have the tools. For the first time since the scroll gave way to the codex, the format of law itself is ready to change, and machines can finally read what a thousand years of governments have written, if we do the unglamorous engineering to let them. Justinian showed the debt can be paid down, and that of everything a civilisation makes, the well-made rule is the part that lasts. The Florentines, frightened, plagued and building anyway, showed what people make once they believe the state is theirs to craft.

For the love of law, and the state as a work of art. That is the mission.

All views expressed here are my own.