Cargo Cult Programming
dead-metaphor Social Behavior → Software Programs
Categories: software-engineeringcognitive-science
What It Brings
During World War II, Pacific Islanders observed that military airstrips attracted planes carrying valuable cargo. After the war, some communities built ritual airstrips — control towers from bamboo, headphones from coconut shells, landing lights from torches — and waited for the planes to return. The form was reproduced perfectly. The underlying mechanism was entirely absent.
This maps onto programming with surgical precision: copying code patterns without understanding why they work.
Key structural parallels:
- Form without mechanism — the cargo cult reproduces the visible surface of a complex system (the airstrip) while missing the invisible causal chain (military logistics, supply chains, geopolitics). In programming, this is copying a design pattern, configuration block, or architectural decision without understanding what problem it solves. The code looks right. It might even work. But the developer cannot explain why, and therefore cannot adapt it when conditions change.
- Ritual as substitute for understanding — cargo cultists performed the right actions in the right order because they had observed that sequence producing results. Cargo cult programmers do the same: they follow tutorials step by step, copy Stack Overflow answers verbatim, and reproduce incantations from blog posts. The ritual works until it doesn’t, and then they have no recourse because they never understood the mechanism.
- Correlation mistaken for causation — the islanders saw airstrips and planes together and inferred a causal relationship. Programmers see code and working software together and infer the same. But the code they copied might contain dead branches, obsolete workarounds, or accidental patterns that happen to not break anything. The cargo cult programmer preserves all of it, afraid to remove any element lest the planes stop coming.
- The observer’s knowledge gap — the metaphor is about the distance between what you can see and what you need to understand. Cargo cults arise precisely where the technology is advanced enough to be opaque. In programming, the gap widens with framework complexity: the more magic a framework performs, the more cargo-cult-susceptible its users become.
Where It Breaks
- The original cargo cults were rational — given the islanders’ available information and causal frameworks, building airstrips was a reasonable inference. The metaphor, as used in programming culture, carries a tone of condescension that erases this rationality. Calling someone a cargo cult programmer implies stupidity, when it often reflects a reasonable response to opaque systems and inadequate documentation.
- The metaphor has colonial baggage — it originates in Western anthropologists describing Pacific Islander practices, and it carries an implicit hierarchy: the observers (who understand the real mechanism) looking down on the imitators (who don’t). Using it in programming reproduces this dynamic: senior developers diagnosing junior developers as cargo cultists, with the same asymmetry of knowledge and power.
- Sometimes copying without understanding is fine — not every developer needs to understand every layer of the stack. Using a library without reading its source code is not cargo cult programming; it’s abstraction. The metaphor doesn’t distinguish between harmful ignorance and productive trust. We all stand on layers of code we don’t understand; the question is where the line falls.
- The metaphor assumes stable mechanisms — cargo cults fail because the mechanism (military logistics) is absent. But in software, the “mechanism” changes constantly: frameworks are updated, APIs are deprecated, best practices evolve. A pattern that was cargo cult behavior yesterday might be best practice tomorrow, and vice versa. The metaphor implies a fixed ground truth that software rarely offers.
Expressions
- “That’s cargo cult programming” — the diagnosis, usually delivered by a senior developer reviewing code they find inexplicably structured
- “Cargo cult configuration” — copying config files without understanding the directives, a particularly common variant
- “Don’t cargo-cult it” — the injunction to understand before imitating, common in code review feedback
- “Stack Overflow-driven development” — the modern variant, where the ritual source is a Q&A site rather than direct observation
- “Copy-paste programming” — the degenerate form, where not even the ritual form is preserved, just the raw text
- “Voodoo programming” — an older synonym with its own problematic cultural baggage, mapping another misunderstood ritual tradition onto coding without comprehension
Origin Story
Richard Feynman introduced the term “cargo cult science” in his 1974 Caltech commencement address (later published in Surely You’re Joking, Mr. Feynman!). Feynman used it to describe research that has the form of science — hypotheses, experiments, publications — but lacks the substance: rigorous controls, honest reporting, genuine falsifiability. The metaphor was irresistible: it named a failure mode that everyone recognized but nobody had articulated.
The extension to programming followed naturally. Eric Lippert (Microsoft developer and blogger) and others applied “cargo cult programming” specifically to coding practices in the early 2000s. The term found fertile ground in a community where copying code from the internet was becoming the dominant mode of development, and where frameworks were growing complex enough to make cargo cult behavior the path of least resistance.
References
- Feynman, R.P. “Cargo Cult Science,” Caltech commencement address (1974), reprinted in Surely You’re Joking, Mr. Feynman! (1985)
- Lippert, E. “Cargo Cult Programming,” Fabulous Adventures in Coding blog (2004) — early application of the term to software development
- McConnell, S. Code Complete, 2nd ed. (2004) — discusses understanding vs. imitation in programming practice