Foo and bar are the placeholder names programmers reach for when they need a stand-in. The Jargon File classifies them as metasyntactic variables: a metasyntactic variable is “a name used in examples and understood to stand for whatever thing is under discussion,” and the File notes that of the many such words in use, “only foo and bar are truly universal” with baz nearly so, and the compounds foobar and foobaz also in very wide currency. When a tutorial defines a function foo that calls bar, no reader is expected to wonder what foo and bar mean; they mean nothing in particular, on purpose.
The Jargon File traces the etymology in some detail. The word foo on its own is older slang, a term of mild contempt or nonsense that the File connects to sources including the prewar “Smokey Stover” comic strip and to Yiddish-flavored exclamations. The pairing of foo with bar, however, the File attributes mainly to the WWII-era Army acronym FUBAR, “Fouled Up Beyond All Recognition” in its polite form, which was softened and respelled into foobar as it migrated into engineering use.
The whimsy around these words is enshrined in an unusual official document. RFC 3092, titled “Etymology of Foo,” was published by the Internet Engineering Task Force on April 1, 2001, authored by D. Eastlake, C. Manros, and Eric Raymond. It opens from a real observation: roughly 212 RFCs going back to RFC 269 had used foo, bar, or foobar as placeholders without ever explaining them, and the memo sets out, in deadpan style, to “rectify that deficiency.” It draws heavily on the Jargon File’s account.
As an April Fools RFC, RFC 3092 is a joke, but it is a joke that the standards process took the trouble to publish and assign a real number, which tells you something about hacker culture’s appetite for documenting its own traditions with mock seriousness. The document carries the same authority format as a genuine technical specification while cheerfully tracing slang from comic strips through wartime acronyms to the source code of the present day.
The lasting significance of foo and bar is practical as well as cultural. Having an agreed set of meaningless names lets programmers and authors write examples without accidentally implying that the name matters, the way real-world names like “customer” or “total” inevitably would. That shared convention, with its tangled and faintly absurd history, is one of the small pieces of common vocabulary that binds the programming community together.