Cargo Cult Programming
Noun · Hacker Culture · Origin: 1974
Definitions
The practice of copying code patterns, configurations, or rituals from working examples without understanding why they work, hoping the incantation alone will produce the desired result. Named after Richard Feynman's 'cargo cult science' analogy.
In plain English: Copying code from somewhere that works without understanding why it works — like performing a rain dance because you saw someone do it before it rained.
Example: "He added five random npm packages to fix a CSS issue. That's pure cargo cult programming."
Common cargo cult patterns include: copying Stack Overflow answers without understanding them, adding configuration flags 'just in case,' and keeping dead code because removing it might break something. The cure is understanding, not copying.
Example: 'Why is there a try-catch around every single line? That's cargo cult programming — someone read that exception handling is important and took it way too literally.'
Source: common patterns
Origin Story
South Pacific rituals and the code that imitates understanding
During World War II, Allied forces built airstrips and supply bases on remote Pacific islands. After the war ended and the bases were abandoned, some islanders built replica runways, control towers, and even headphones from coconuts, hoping to attract the cargo planes back. They performed the rituals of air traffic control without understanding the underlying system. Anthropologists called these **cargo cults**.
Physicist **Richard Feynman** popularized the metaphor in his 1974 Caltech commencement address, coining "cargo cult science" for research that follows the forms of science without the substance. Programmers adopted it as **cargo cult programming**: copying code patterns without understanding why they work, performing rituals (try/catch blocks, design patterns, configuration incantations) because someone said to, not because the developer understands the purpose.
Classic examples include: wrapping code in a try/catch block and silently swallowing exceptions, adding random `async/await` keywords until code works, or copying Stack Overflow answers without reading past the first line. The code works (sometimes), but the understanding isn't there.
Coined by: Richard Feynman (popularized the 'cargo cult' metaphor)
Context: Caltech commencement address, 1974; programming adoption, 1990s
Fun fact: Feynman's cargo cult science speech also introduced the concept of 'bending over backwards to show how you might be wrong' as the defining characteristic of genuine science. It's one of the most-quoted graduation speeches in scientific history.