Pattern Language
Last updated: Wed Nov 06 2024
These are various “patterns” that I tend to use and reuse in my thinking. This page is inspired in no small part by Jacky Zhao’s “A Pattern Language” and her list of patterns. Is this really accurate to Christopher Alexander’s A Pattern Language? No idea, but I find this useful.
Table of Contents
Open Table of Contents
- Chesterton’s Fence
- Cultural Niche
- Cultural Evolution
- Deliberate Practice
- Digital Garden
- Dunbar’s Number
- Eternal September
- Eyes on the Street
- Goodhart’s Law
- Illusion of Explanatory Depth
- Magical Number Seven, Plus or Minus Two
- Principal-Agent Problems
- Programming as Theory Building
- Rubber Duck Problem Solving
- Scenius
- Spaced Repetition
- Speed Matters
Chesterton’s Fence
Before you remove a fence, figure out what it’s for.
Details
Thanks to cultural evolution, many perplexing human behaviors are actually adaptive, even if participants can’t actively explain themselves. If you suddenly change that behavior, you might find that it was load-bearing — it was completely necessary for surrounding systems to function! So, it’s often worthwhile to investigate before changing, especially if a behavior seems confusing.
Because humans occupy the cultural niche and many of our behaviors can be looked at through a cultural lens, Chesterton’s Fence can be applied to many different fields. Programming is a particularly fruitful field — whenever dealing with legacy code, it’s always useful to ask why the code behaves the way it does, even if it’s strange (for instance, being written in COBOL!).
See Also
- “Chesterton’s Fence”, Matt Rickard
- “Lens of the week: Chesterton’s Fence”, The FLUX Review
Cultural Niche
Humans are uniquely successful due to our social learning ability.
Details
Humans are not the only intelligent animal; humans are not the only tool-using animal; humans are not the only social learning animal. However, humans are almost unique in their ability to socially learn across generations, slowly accumulating more effective tools, processes, thinking patterns, and organizations of relationships to solve day-to-day challenges, the sum total of which we call “culture.” Our biology is in fact evolved to promote just this ability, which is adaptable to nearly every environment; in a very real sense, our “niche” as a species is “anything we can learn to do from others.”
See Also
- The Secret of Our Success: How Culture is Driving Human Evolution, Domesticating Our Species, and Making Us Smarter, Joseph Henrich
- Cultural Evolution: How Darwinian Theory Can Explain Human Culture and Synthesize the Social Sciences, Alex Mesoudi
- “A Rant About ‘Technology’”, Ursula K. Le Guin
- My own culture & technology reading list
Cultural Evolution
Culture is subject to evolutionary pressures.
Details
The logic of Darwin’s theory of natural selection only requires three preconditions:
- Variation in traits across a population.
- Inheritance of traits across generations, with modification between generations.
- Differential fitness — some traits are more likely to be inherited across generations than others.
If a trait meets these three preconditions, we should expect to see evolution — a directed change in the proportions of a trait across a population across time. Notably, as Mesoudi’s Cultural Evolution points out, Darwin’s logic does not rule out Lamarckian (within-generation) evolution or require particulate inheritance, both of which are parts of biology’s modern synthesis. As a result, human cultural behaviors can also be considered as subject to evolutionary pressures, albeit following a different model than the biological synthesis.
This has all kinds of implications; for instance:
- Many cultural behaviors are adaptive, but individuals in the population may have no understanding of why they follow the behaviors they do! Henrich uses the example of manioc, a tuber native to the Americas that contains cyanide, but is happily consumed by native peoples of the Amazon thanks to a convoluted multistep leaching process that nobody understood until the introduction of modern scientific instruments.
- Culture is sensitive to interventions and broken chains of transmission, causing cultural drift, where traits are randomly lost due to small population size. The Baffin Island Inuit lost kayaks as a technology and didn’t regain it until accidentally contacting other Inuit groups. Japan had a massive influx of firearms in the 16th century, but they were banned by the victorious bakufu and mostly forgotten a century later.
See Also
- The Secret of Our Success: How Culture is Driving Human Evolution, Domesticating Our Species, and Making Us Smarter, Joseph Henrich
- Cultural Evolution: How Darwinian Theory Can Explain Human Culture and Synthesize the Social Sciences, Alex Mesoudi
- War in Human Civilization, Azar Gat
- Giving Up the Gun: Japan’s Reversion to the Sword, 1543-1879, Noel Perrin
- “Is Cultural Change a Darwinian Process? No.”, W. David Marx (for a contrary take)
Deliberate Practice
Deliberately practicing skills can be the most effective way to improve them.
Details
Setting aside time (the famous “10,000 hours”) to deliberately practice individual skills can be the most effective way to improve a skillset. Indeed, as Andy Matuschak explores in “Implicit practice,” relying on the “implicit practice” provided by a discipline’s usual work can lead to skill gaps we’re not even aware of!
We should be careful taking this too far. David Epstein’s Range argues that breadth is a depth all its own — in many disciplines, the top performers are actually people that explored a range of topics or disciplines and didn’t get 10,000 hours of practice. In particular, he argues that deliberate practice doesn’t work for “wicked problems”, where feedback is delayed or hard to interpret.
Still, for many disciplines, from art to writing to programming to athletics, there are individual skills that are amenable to deliberate practice.
See Also
- “The Role of Deliberate Practice in the Acquisition of Expert Performance”, Ericsson et. al.
- “The Role of Deliberate Practice in the Acquisition of Expert Performance”, James Somers
- “Implicit practice: a sight reading parable”, Andy Matuschak
- “Having a creative practice as a programmer”, the scapegoat dev
- “Some reasons to work on productivity and velocity”, Dan Luu
- “95%-ile isn’t that good”, Dan Luu
- Range, David Epstein (for a contrary take)
Digital Garden
Treat a personal website as a work-in-progress wiki, not a reverse-chronological blog.
Details
“Digital gardening” is a recent movement to treat personal websites more like always-in-progress personal wikis instead of a traditional reverse-chronological blog. That might involve publishing unpolished notes, updating pages when you learn more, linking heavily between pages, distinguishing between different classes of recency, and so on. This site is inspired by the principles of digital gardening, since I intend most pages to be “evergreen” and updated over time, although I don’t take the concept as far as many others do.
See Also
- “Digital Garden”, Aaron Young
- “Work with the garage door up”, Andy Matuschak
- “A Brief History & Ethos of the Digital Garden”, Maggie Appleton
- “Digital Gardening for Non-Technical Folks”, Maggie Appleton
Dunbar’s Number
Stable human social groups are limited to about 150 people.
Details
Robin Dunbar is a fairly prominent anthropologist — I highly recommend his books Friends and Why Religion Evolved — but he is most famous for his eponymous number, introduced in “Neocortex size as a constraint on group size in primates”. He studied the average group sizes of other social primates and discovered a striking relationship between group size and neocortex size. If you plug humans into the resulting equation, you get “Dunbar’s number” of about 150, which is the maximum size of a stable social group, or how many “close” interpersonal relationships we can have. This has been borne out by repeated studies of human social groups, from militaries to churches to Discord channels. Social groups that grow much bigger than Dunbar’s number need more complicated organizational structures to make up for the fact that most members will not, and indeed cannot, know most other members.
See Also
- ”Neocortex size as a constraint on group size in primates”, Dunbar et. al.
- “Dunbar’s number and how speaking is 2.8x better than picking fleas”, Matt Webb’s Interconnected
- “Platoons - a natural unit size for a modern army”, Lindybeige
- Friends: Understanding the Power of our Most Important Relationships, Robin Dunbar
- “Dunbar’s Number is Quadratic”, Johnny Nelson
Eternal September
Communities struggle to assimilate large numbers of new people arriving at the same time.
Details
Before 1993, the proto-web message boards of Usenet saw a yearly influx of new users around September, when new university students got access to Usenet for the first time. At first, these new arrivals would have poor etiquette, but through a mixture of shaming, mockery, trolling, and simple observation, they would socialize to the standards of Usenet. Around 1993, service providers began providing much larger numbers of users with access to Usenet, leading the forums to become overwhelmed with badly-behaved users (at least, from the perspective of old-timers). That led some to refer to this period as an “Eternal September.”
The broader lesson here is that communities, if they are to remain communities, need time to socialize new arrivals into the culture of the community. Otherwise, they risk becoming a place where strangers mostly interact with strangers, where there is no sense of shared norms and few repeated interactions that would encourage politeness.
See Also
- “September that never ended”, Jargon File
- “Killing Community”, Marginalia.nu
- “No More Eternal Septembers”, Tedium (for a more negative take on this mindset)
Eyes on the Street
A feeling of safety in urban environments is provided by having many “eyes on the street”.
Details
What makes a neighborhood feel safe or unsafe? Why did so many of the housing projects of the mid-twentieth century fail so spectacularly?
One of the major arguments of Jane Jacobs’ Death and Life is that neighborhoods feel safe when they are more lively — when there are a wide variety of people going about many different activities at all times of day, providing many “eyes on the street” to deter wrongdoing. After all, most humans are naturally cooperative and willing to step in if something untoward is happening.
Good neighborhoods — like, say, San Francisco’s North Beach — support many uses, from children going to school in the morning to workers in the office during the day to diners eating out in the evening to revelers partying at night. Bad neighborhoods — like, say, San Francisco’s Civic Center — are oriented around a single purpose, like civic administration or corporate offices, and remain desolate at “abnormal” times. The mid-twentieth century housing projects of high modernism, like Le Corbusier’s “tower in a park” idea, were ineffective because they segregated different purposes.
When in a new neighborhood, pay attention to how many “eyes on the street” you can notice.
See Also
- The Death and Life of Great American Cities, Jane Jacobs
- Seeing Like A State, James C. Scott
Goodhart’s Law
When a measure becomes a target, it ceases to be a good measure.
Details
We have some property of the world we want to change. It’s difficult, or impossible, to measure, so we instead focus on a proxy that we can measure. But then we’re optimizing exactly the wrong thing, and we end up with nonsensical results!
We should, however, be careful of taking this idea too far. As Cedric Chin points out in “Goodhart’s Law Isn’t as Useful as You Might Think”, more limited instances of Goodhart’s law are solvable via the techniques of Deming’s statistical process control. Additionally, picking some measure has benefits — otherwise, how would we know we’re changing anything at all?
Still, we should be careful which measures we pick and how seriously we take them. We should never pursue optimization for its own sake.
See Also
- “Goodhart’s Law in Software Engineering”, Hillel Wayne
- “In Defense of Slow Feedback Loops”, Hillel Wayne
- “Goodhart’s Law Isn’t as Useful as You Might Think”, Cedric Chin
Illusion of Explanatory Depth
Humans think they understand familiar systems better than they actually do.
Details
How does a toilet work? A car? A computer? The economy?
For systems we’re familiar with, we tend to rate our understanding highly, but in practice most people can barely explain the basics of how a toilet works. This isn’t necessarily a bad thing — humans are great at compartmentalizing what we need to know and what we don’t. However, it can backfire when we forget that we don’t really understand things that we think we do.
See Also
- “Underrated ideas in psychology: The illusion of explanatory depth”, Adam Mastroianni
- “What scientific term or concept ought to be more widely known?: The Illusion of Explanatory Depth”, Adam Waytz
- “A Rant About ‘Technology’”, Ursula K. Le Guin
Magical Number Seven, Plus or Minus Two
Human short-term memory is limited to seven (plus or minus two) “chunks”.
Details
Extensive research has shown that human short-term memory is limited to about seven items. Importantly, this doesn’t mean seven bits — experts are able to construct higher-level representations or “chunks” that allow them to remember more.
This principle can be applied widely anywhere human cognition is important. For instance, as Loup Vallaint argues, “readability” in software engineering is simply a function of limited short-term memory. Global variables are hard to understand because they take up precious memory space. Composition is better than inheritance because inheritance inherently requires keeping track of multiple interacting parent and children classes.
See Also
- “The Magical Number Seven, Plus or Minus Two: Some Limits on our Capacity for Processing Information”, George A. Miller
- “The Source of Readability”, Loup Vaillant
Principal-Agent Problems
When an agent takes actions on behalf of a principal, care must be taken to align incentives.
Details
In social life, it is often the case that one party (the principal) has access to capital or other resources and uses these to hire the services of another party (the agent). However, how does the principal know the agent will actually do as they wish, and how does the agent know the principal will likewise maintain their commitments? This is a fundamental issue that requires careful mechanism design.
One of the most famous examples is stock-option-based compensation for early startup employees in the tech industry. Venture capitalists invest millions of dollars in startups. Why don’t the founders take the money and run? Why do early employees put up with harsh working conditions, when the company can barely afford to pay them? Their primary compensation comes in the form of stock options, which are only valuable insofar as the company itself is valuable, aligning incentives between the funders and the founders. (Tom Nicholas points out in VC: An American History that early-19th-century American whaling expeditions settled on an identical solution.)
See Also
- “The Principal-Agent Problem: You’re Always Solving Multiple Problems at Once”, Byrne Hobart
- VC: An American History, Tom Nicholas
Programming as Theory Building
Programming is the process of building theory of how a problem is solved, not the production of a program.
Details
Why is it difficult for a new team to take over development of a program? Why does documentation sometimes prove useless for understanding a system?
Peter Naur argues in this paper that programming is often misunderstood — it is not the process of producing an artifact that we call a “program”, but rather it is the process of the programmer developing a “theory” of how a particular problem can be solved using a program. In this view, the activity of “programming” just is developing this theory and then applying it, with the corollaries that:
- A new team cannot be productive modifying an existing program until they have developed a theory of the program themselves.
- Documentation may be helpful during the theory-building process, but is no substitute for theory-building itself.
See Also
- “Programming as Theory Building”, Peter Naur
Rubber Duck Problem Solving
Talking through a problem in as much detail as possible can help solve it, even if you’re just talking to a rubber ducky.
Details
One of the best problem-solving techniques from software engineering is to explain the problem and attempted solutions in as much detail as possible. It doesn’t matter whether you’re talking to another software engineer or even another person; you could even use a literal rubber ducky! The important part is to explain the problem in as much detail as possible, because it helps clarify your assumptions and will often reveal overlooked details.
See Also
- “Rubber Duck Problem Solving”, Jeff Atwood
Scenius
”Scenes” are often more inventive than individuals.
Details
Scenius is a concept coined by Brian Eno to describe the fact that groups of creative individuals in the same time and place — a “scene”, if you will — are often much more inventive than the individuals themselves. This is arguably the “micro” version of cultural evolution as described above. There are many examples, from literary groups like the Inklings or the Bloomsbury Group, to the invention of modern climbing at Camp 4 in Yosemite, to the flow of conversation at a really good dinner party.
See Also
- “Scenius, or Communal Genius”, Kevin Kelly
- “How to Walk and Talk”, Craig Mod
- “The Scenius Edition”, Why is this interesting?
Spaced Repetition
Memorize anything efficiently by reviewing at spaced intervals.
Details
Ebbinghaus’ forgetting curves show that the most efficient way to remember something is to test yourself at increasingly-spaced intervals. As a result, with the help of spaced-repetition software and careful choice of flashcards, you can efficiently remember virtually anything you choose to. Moreover, you can use memorized details as building blocks for more complex thoughts, allowing you to learn arbitrarily-complex topics with greater effectiveness.
See Also
- “Augmenting Long-Term Memory”, Michael Nielsen
- “How to make memory systems widespread?”, Michael Nielsen
- “Spaced Repetition for Efficient Learning”, Gwern
- “Effective Spaced Repetition”, Fernando Boretti
- “How to write good prompts: using spaced repetition to create understanding”, Andy Matuschak
Speed Matters
Working quickly is important.
Details
Working fast means you can get more done per unit time. But as James Somers points out in his essay, there’s two other benefits to working fast:
- You lower the activation energy of starting a new project — you’re more likely to start a project if you think it will be quick and effortless.
- Because you can get more done in the same time, you get more deliberate practice.
See Also
- “Speed matters: Why working quickly is more important than it seems”, James Somers
- “Being a Fast, Cogent Writer Is Useful ”, Chris Krycho
- “Some reasons to work on productivity and velocity”, Dan Luu
- “Fast Tools are Wonderful ”, Chris Krycho