Where foo and bar come from: the only variable with its own RFC
The placeholder in half of all code examples traces back through a WWII vulgarity, a 1959 model railroad club dictionary, and a 1930s comic strip. The internet's standards body eventually gave it an official etymology, published on April 1st.
AI-assisted postDrafted with help from Claude, edited and fact-checked by Mart. See transparency policy →
The MIT Tech Model Railroad Club layout. The club's 1959 dictionary canonized "foo" for hackerdom, between running the trains. Photo by Josh Graciano, CC BY-SA 2.0.
Every programmer has typed foo and bar thousands of times without asking why, and the answer is unusually well documented, because the question eventually annoyed the internet's standards process into action. By 2001, roughly 212 RFCs had used foo, bar or foobar as placeholder names without a single one explaining them, so Donald Eastlake, Carl-Uno Manros and Eric S. Raymond wrote RFC1 3092, "Etymology of Foo" — an actual RFC whose entire subject is this word. It was published on April 1st, which is the correct date for a standards document that quotes a model railroad club's prayer book.
🔗 Learn more — 1 What is an RFC?
The comic strip, 1930s
The oldest documented root is Bill Holman's surrealist firefighter comic Smokey Stover, which ran from the 1930s to 1952 and scattered the word FOO everywhere for pure nonsense value — on license plates, in signs, in catchphrases like "He who foos last foos best". Holman claimed he found the word on a Chinese figurine, plausibly the character 福 (fu, often romanized foo), meaning happiness — which would make the most-typed placeholder in programming a distant cousin of a blessing. A generation of American kids absorbed FOO as the canonical funny non-word, and some of those kids went on to MIT.
The war and the railroad club
The military's FUBAR — F'ed Up Beyond All Recognition — is usually told as foo's origin, but RFC 3092 runs the arrow the other way: "it now seems more likely that FUBAR was itself a derivative of 'foo'," possibly influenced by the German furchtbar — terrible. The soldiers had read the comics too. Either way FUBAR gave foo its lifelong companion: strip the vulgarity and bar falls out, and foo, bar became a natural pair the way Adam and Eve are.
The word's induction into computing happened where so much early hacker vocabulary did: MIT's Tech Model Railroad Club, whose 1959 dictionary defined it with full mock solemnity:
"Foo: The sacred syllable (FOO MANI PADME HUM); to be spoken only when under obligation to commune with the Deity."
A Buddhist mantra with the Om swapped for a comic-strip nonsense word. From TMRC the syllable flowed into the PDP-1 rooms, into early Unix culture, and into the example code of every language since. Like daemon, it is an in-joke that got institutionalized; unlike daemon, it never even pretended to mean anything.
Why placeholders matter enough to standardize
The genuinely useful idea under the joke: programming needs words that are guaranteed meaningless. A tutorial that names its example function calculate teaches the wrong lesson — the reader wonders what it calculates. Name it foo and the meaninglessness is the message: this could be anything, look at the structure, not the name. Linguists call these metasyntactic variables, and every culture that writes code evolves them (the French use toto, the British sometimes wibble). That is what RFC 3092 was actually for — not the jokes, but so that a non-native English speaker reading their 212th foo could finally be told, officially, that it has meant nothing since the 1930s, on purpose.
The lane's usual pattern is a name that meant something once and fossilized — grep's command syntax, git's self-insult. Foo is the inverse fossil: a word preserved seventy years precisely because it never meant anything. Meaning would have ruined it.
foo/bar: from Smokey Stover's 1930s nonsense FOO (possibly Chinese 福, happiness), through WWII's FUBAR (probably derived from foo, not the reverse), canonized in MIT TMRC's 1959 dictionary, and given an official etymology in RFC 3092 — published April 1, 2001, sincerely.
Read next


