Frameworks
A library is code you call, a framework calls yours. Mendeleev left blanks in a table, Le Verrier found Neptune and never found Vulcan, and the Forest Service aimed to put out every fire by 10 a.m. for decades. Both parties run on frameworks too.
+25
Click to enlarge
A programmer starting a web application writes a few dozen lines and runs them, and the lines never run as a program of their own. Something else starts first. It listens for a request, decides which of the programmer’s functions should answer it, checks who is asking, opens a connection to the database, and calls the function. The function returns, and the framework wraps what comes back in a page and sends it. The programmer’s code is a set of answers to questions somebody else gets to ask.
The software behind this collection of essays works that way twice over, a Django backend for the writing and a Next.js frontend for the pages. Neither was our idea of how a blog should be organized, and both arrived with one. The Django admin has a view in which an editor sees posts, tags and authors in a certain order. The Next.js router decides that a folder named [slug] is a page for any slug whatever. Version 16 of Next.js changed route parameters so that they arrive as promises, and every page that used them the old way stopped working until someone rewrote it.
Programmers have a name for the difference between that arrangement and the more modest one in which they simply use someone else’s code. A library is a set of functions you call, when you want them, in the order you choose. A framework calls you. Martin Fowler, writing about it in 2005, put the point as inversion of control and called it “a key part of what makes a framework different to a library.” The nickname for it, “Don’t call us, we’ll call you,” Fowler traces to Richard Sweet’s work on the Mesa programming environment in the early 1980s, where it was known as Hollywood’s Law. The term itself he credits to Ralph Johnson and Brian Foote, who used it in 1988 in a paper on reusable classes.
Three features come with the inversion. A framework supplies slots, places where your code is expected, with a name and a shape. It supplies defaults, so that what you don’t specify gets decided anyway. And it supplies a sense of what is normal, which makes some work a few lines and other work a rebuild. David Heinemeier Hansson, whose Rails framework appeared in 2004, made the second feature a slogan: convention over configuration. Under Rails a database table named posts belongs to a class named Post without anyone saying so, and a developer who wants it called something else spends an afternoon.
This essay is about what happens when that arrangement shows up elsewhere, and it shows up in at least two places a programmer wouldn’t expect: in how sciences organize what they look for, and in how politics organizes who gets to win. An ideology defines what you believe, and a framework defines how beliefs become organized action. Science has the same distinction, between a theory and the way a field arranges work around it.
Slots in a table
In 1871 Dmitri Mendeleev published a version of the periodic table with gaps in it. Where the arrangement by atomic weight and chemical behavior called for an element and none was known, he left a blank and named the missing one by the element above it, adding the Sanskrit prefix eka: eka-aluminium, eka-boron, eka-silicon. He also wrote down what each should be like. Eka-aluminium would have an atomic mass near 68 and a density near 6.0 grams per cubic centimeter. Four years later Lecoq de Boisbaudran found gallium, which measures 69.7 and 5.91. Eka-silicon was forecast at 72 and 5.5, and when Clemens Winkler isolated germanium in 1886 it came in at 72.6 and 5.32. Scandium filled eka-boron in between, in 1879.
Nobody calls on a chemist to find an element when the table has no blank. A blank appeared because the framework had a place where the element should be, and chemists went and filled it. That is the Hollywood principle at work in a science: the table calls the chemist, and the chemist answers with a mass, a density, a color.
The same mechanism can ask for something that isn’t there. In 1846 Urbain Le Verrier took the unexplained wobble in the orbit of Uranus and computed where an unseen planet would have to be to cause it. Johann Galle pointed the Berlin telescope at the spot on the night he received the letter and found Neptune within about a degree of it. Thirteen years later Le Verrier looked at Mercury, whose orbit turned slowly in a way Newton’s equations left short by roughly 38 arcseconds a century (the modern figure is 43), and used the identical move. A planet inside Mercury’s orbit would close the gap. In March 1859 a country physician and amateur astronomer, Edmond Lescarbault, reported to him a small dark disc crossing the sun. Le Verrier traveled to see the man, was satisfied, and the next year told the Academy of Sciences that the planet existed. It was called Vulcan, reports of sightings kept coming for decades, and it was never there. Le Verrier died in 1877 still waiting. The residual in Mercury’s orbit was explained in November 1915 when Einstein worked out what general relativity predicted for it and got 43 arcseconds. There was no slot. The framework that had told astronomers where to look was replaced by one in which the place was empty.
Carl Linnaeus’s framework had slots that were never meant to be empty. Every organism in the Systema Naturae sits under a class, an order, a genus and a species, and a naturalist who found a new beetle had to write something in each field. Linnaeus thought the genus and the species were what God made and the higher ranks were his own convenience, but the scheme worked as a form, and a form wants filling out. When Willi Hennig argued in the 1950s that classification should record only branching ancestry, the first thing to go was the premise that every group has a rank. A rank had never been a measurement, and “family” didn’t mean the same thing in beetles that it meant in mammals.
What a framework sees as a bug
Ecology offers a case in which the framework’s idea of normal had a body count. In 1916 Frederic Clements described a plant community as something like an organism, one that develops through stages toward a stable climax fixed by climate, and that, if disturbed, grows back to the same form. Henry Gleason answered in 1926 that an association was nothing more than the plants whose requirements happened to overlap on a patch of ground, which was why neighboring stands never matched. Ecologists have since put both views through decades of fieldwork and landed somewhere between them.
In 1935 the United States Forest Service adopted what became known as the 10 a.m. policy: every fire was to be controlled by 10 a.m. the morning after it was reported. A forest whose natural course was to a stable climax had no use for a fire except as damage, and a forester who put one out was fixing a fault. The policy loosened in the 1970s, with some wilderness fires allowed to burn, and was dropped in 1978. In the summer of 1988, with the let-burn programs only a few years old, fires burned more than a third of Yellowstone National Park. The ecology of the park had never needed fire to be a bug. The framework had said it was one, and decades of work were organized around fixing it.
Thomas Kuhn gave this part of the matter its name in 1962. A paradigm, in his sense, is a framework plus the community that works within it. It defines which questions are worth asking, which instruments to build, which results to count as discoveries and which as errors. Most science, he said, is puzzle-solving inside it, filling in the slots. An anomaly is a result the framework can’t place, and the community’s first response is to doubt the measurement, then to add a patch, and only after the anomalies pile up past patching does a crisis open the way for a different framework.
Imre Lakatos, a few years later, gave the patching a structure. A research programme has a hard core that its practitioners agree not to touch, and around it a protective belt of auxiliary hypotheses that take the blows. Vulcan was a belt hypothesis: the core, Newton’s gravity, stayed fixed, and a missing planet absorbed the anomaly. The same move had worked once, with Neptune, and a belt is no less useful for being right sometimes. A programme stays healthy as long as its belt predicts things that turn out to be there. The belt degenerates when it only explains after the fact why the anomaly doesn’t count.
Frame of government
The word was in use for politics well before software. William Penn’s 1682 Frame of Government for Pennsylvania was a constitution, in the sense of the joists and rafters of a building, and it didn’t survive its first assembly. A shorter frame replaced it the next year. When Pennsylvania wrote its own state constitution in 1776, the document was titled a “Plan or Frame of Government.” The builders of the first American states used the word because they thought of government as a structure on which other things were hung.
The federal Constitution is a framework in the software sense, with slots that other people were expected to fill. Article I, Section 4 says that the times, places and manner of holding congressional elections shall be prescribed in each state by its legislature, and that Congress may at any time by law make or alter such regulations. That sentence is a hook with an override. Nothing in the document mentions a political party, and in 1796 Washington’s farewell address warned against them. Yet the states filled the hook, and Congress occasionally overrode it, and a good part of what Americans call their two-party system is what the filling produced.
Take the ballot. Until the late 1880s a voter in most states took a ticket printed and distributed by a party, often in a color so recognizable that anyone watching could see how a man voted, and dropped it in the box. In 1888 Massachusetts adopted the Australian ballot, printed by the state and marked in secret, and within about a decade most other states had followed. A party was now a field on a form the state designed. The state decided who was entitled to a line, how many signatures got a candidate on it, and whether one person could appear under two lines. In 1997, in Timmons v. Twin Cities Area New Party, the Supreme Court upheld, six to three, a Minnesota law that kept a candidate from being nominated by two parties, and counted the stability of the two-party system among the interests the state could weigh. The Cross-Filing essay follows what happened in states that left that field looser.
A second default arrived in 1967, when Congress required House members to be elected from single-member districts. Maurice Duverger had observed in 1951 that plurality voting in single-member districts tends toward two parties, and the law set that default for every state in the country. No one in the House of 1967 was installing a two-party system. They were choosing a convention for districts, and the convention had effects that configuration would have taken years to build.
Five layers, and what each party calls its own
The matter sorts into levels, from the philosophical to the practical, each one a set of slots for the one beneath it:
| Level | What it settles | Software analogy |
|---|---|---|
| Philosophy | Why society should be organized one way | Programming paradigm |
| Ideology | The broad beliefs and aims | Language |
| Framework | The reusable structures that organize action | Framework |
| Platform | Specific positions and commitments | Application |
| Campaign | The concrete work of carrying them out | Deployment |
Political scientists reached something close to it independently. Paul Sabatier’s advocacy coalition framework, first set out in 1988 and developed with Hank Jenkins-Smith, describes the belief system of a coalition in three tiers: a deep core of basic normative commitments, a policy core that applies them to a particular field, and secondary aspects, the instruments and administrative detail. The deep core, in Sabatier’s account, changes about as often as a person changes religion. The secondary aspects change with each new study. It is Lakatos’s hard core and protective belt in a policy setting, and the two tiers carry the same traffic: everything is argued in the outer layer so that nothing has to be argued in the inner one.
Applied to the two parties that between them hold every seat of consequence in the country, the table suggests that most of what is visible about them is platform, and most of what matters is framework. The two do not sit on the same ideology with different platforms. Each has built a different kind of machine.
The program framework
The Democratic Party’s governing framework, going back to the New Deal and the Great Society, runs on statute, agency and grant. Congress writes an enabling law, deliberately general, and a bureau fills in the details by rule. The Administrative Procedure Act of 1946 supplied the interface for rulemaking, and for forty years, from Chevron v. NRDC in 1984, courts deferred to an agency’s reading of an ambiguous statute, a default that treated every gap Congress left as a slot for an agency. Money goes out to the states under conditions, and the conditions are hooks. In South Dakota v. Dole in 1987 the Court upheld a law withholding five percent of a state’s highway funds from any state with a drinking age under twenty-one, which reached a result Congress could not have reached by command. In 2012 the Court held in NFIB v. Sebelius that threatening a state’s existing Medicaid money to force an expansion went past persuasion into coercion. The framework could call, but not without limit.
On the receiving end, the party is a coalition of constituencies, each with its own concerns and its own advocacy organizations, and most of them attached to a program or a category in the law. A constituency is a module: it plugs into the larger structure through the interface of a protected class, a funded program, a statutory entitlement. That has been the framework’s strength, because it gives a person in a particular situation something to point at, and a deliverable that reaches them.
It also has the framework’s weaknesses. A program is hard to retire, since people have built lives on its slots. A default that makes agencies the place where ambiguity gets settled stops working on the day the courts withdraw it, and on June 28, 2024 in Loper Bright Enterprises v. Raimondo six justices overruled Chevron, which had the effect of a breaking change in a framework’s core. Every rule written on the old assumption had to be checked against the new one. And the protective belt has its own characteristic patch. A program that falls short of its goal is found to have been underfunded, or reached too few people, or gone unevenly implemented. Sometimes that is true. The belt is also a way of leaving the core unexamined.
The fusion framework
The Republican Party’s framework was assembled in the opposite direction. Frank Meyer, writing at National Review in the late 1950s and 1960s and collecting the argument in In Defense of Freedom in 1962, proposed that libertarians, traditionalists and anti-communists could hold a single coalition together by an agreement to treat the things they disagreed about as secondary. That was called fusionism, and it was a framework in the exact sense: a shared interface through which three groups with different deep cores could still call the same functions. Libertarians got lower taxes and fewer regulations, traditionalists got judges and the schools, and the anti-communists got a defense budget.
The framework produced its own instruments. In 1982 a group of law students founded the Federalist Society, which gave the interpretive approach of originalism and textualism a way to find, train and place people in the courts, so that the courts could act as the callback for decisions the legislative process left open. In 1986 Americans for Tax Reform began asking officeholders to sign a pledge never to vote for a net tax increase, a promise that was written once and then fired automatically at every vote. And in September 1994 hundreds of House candidates stood on the Capitol steps and signed the Contract with America, ten bills promised for a vote within the first hundred days, which is as close as American politics comes to a specification.
Its weaknesses sit where its modules meet. A framework held together by agreement not to argue the deep core gets stressed whenever the core is the question, and it has been tested in recent years by a division between those who want government kept small and those who want it used. The 2020 Republican convention adopted no platform of its own. It passed a resolution continuing the 2016 document and supporting the president, which is a framework running without a platform. And its belt has a characteristic patch of its own: a tax cut that fails to raise the revenue promised is found to need more time, or deeper cuts, or a spending side that hasn’t followed. Again, the claim is sometimes right.
Each party’s framework defines the other’s defaults as faults. To the program framework a market outcome that leaves someone out is a gap in the code, a place where a slot should have been defined. To the fusion framework an agency interpreting an ambiguous statute is a function that has overstepped its call. Neither sees a bug in its own architecture, since by construction its own architecture is what counts as a working system. Why Neither Party Wants Social Liberty approaches the same fact from the direction of what each leaves out, and A Third View of the State takes up Thomas Sowell’s older distinction between constrained and unconstrained visions, which corresponds to the deep core.
What a frame shift looks like
Interfaces used the word transition for movement through the layer where two things meet, and spoke of a frame shift as what liberty needs in order to work. A frame shift in the sense of this essay is what happened to Mercury. The anomaly stayed where it was. The astronomers who looked at it through Newton’s framework searched for a planet, and the astronomers who looked through Einstein’s found nothing to search for. A new framework doesn’t pick up the old one’s slots and fill them better. It changes which slots exist.
That makes a frame shift hard to produce from inside a framework, and impossible to produce by choosing a third option on the same line. A vote between the program framework and the fusion framework is a vote between two sets of slots. What the history of science shows is somewhat different: Mendeleev’s blanks were filled because a table made them visible, and Vulcan’s was never filled because it was a blank only in a table that had stopped being right. Which of them any given empty place in a political framework is, nobody can say from inside it. Le Verrier was a better mathematician than almost anyone alive, and he spent the last eighteen years of his life looking.
Sources
- Martin Fowler, “Inversion of Control” (2005); Ralph E. Johnson and Brian Foote, “Designing Reusable Classes,” Journal of Object-Oriented Programming 1 (1988).
- David Heinemeier Hansson, Ruby on Rails and “convention over configuration” (2004).
- Mendeleev’s predicted elements, Wikipedia; Dmitri Mendeleev, “Die periodische Gesetzmässigkeit der chemischen Elemente,” Annalen der Chemie und Pharmacie, Supplement 8 (1871).
- Vulcan (hypothetical planet), Wikipedia; “The Ninth Planet That Wasn’t,” NOVA; Albert Einstein, “Erklärung der Perihelbewegung des Merkur aus der allgemeinen Relativitätstheorie,” Sitzungsberichte der Preussischen Akademie der Wissenschaften (1915).
- Systema Naturae, Wikipedia; Willi Hennig, Phylogenetic Systematics (1966).
- Frederic E. Clements, Plant Succession: An Analysis of the Development of Vegetation (1916); H. A. Gleason, “The Individualistic Concept of the Plant Association,” Bulletin of the Torrey Botanical Club 53 (1926).
- U.S. Forest Service Fire Suppression, Forest History Society; Yellowstone fires of 1988, Wikipedia.
- Thomas S. Kuhn, The Structure of Scientific Revolutions (1962); Imre Lakatos, “Falsification and the Methodology of Scientific Research Programmes,” in Lakatos and Alan Musgrave, eds., Criticism and the Growth of Knowledge (1970).
- William Penn, Frame of Government of Pennsylvania (1682); Frame of Government of Pennsylvania, Wikipedia; Pennsylvania Constitution of 1776, “Plan or Frame of Government.”
- U.S. Constitution, Article I, Section 4; George Washington, Farewell Address (1796).
- Timmons v. Twin Cities Area New Party, 520 U.S. 351 (1997); Secret Ballot, First Vote, University of Virginia; Massachusetts Secretary of the Commonwealth, Elections in Massachusetts.
- Maurice Duverger, Les partis politiques (1951); Public Law 90-196 (1967), codified at 2 U.S.C. § 2c.
- Paul A. Sabatier, “An Advocacy Coalition Framework of Policy Change and the Role of Policy-Oriented Learning Therein,” Policy Sciences 21 (1988); Sabatier and Hank C. Jenkins-Smith, eds., Policy Change and Learning: An Advocacy Coalition Approach (1993).
- Administrative Procedure Act, 60 Stat. 237 (1946); Chevron U.S.A. Inc. v. Natural Resources Defense Council, 467 U.S. 837 (1984); Loper Bright Enterprises v. Raimondo, 603 U.S. 369 (2024).
- South Dakota v. Dole, 483 U.S. 203 (1987); National Federation of Independent Business v. Sebelius, 567 U.S. 519 (2012).
- Frank S. Meyer, In Defense of Freedom: A Conservative Credo (1962); Americans for Tax Reform, Taxpayer Protection Pledge (1986); Republican National Committee, 2020 convention resolution on the platform.
- Thomas Sowell, A Conflict of Visions (1987).
A note on how this piece was written: the subject, the idea that frameworks in software, science and politics share one structure, and the five-level scheme from philosophy to campaign are mine. Much of the research, the examples, and the sentences were drafted by an AI model working from that direction, and then edited by hand. I’d rather say that plainly than have a reader guess at it.