Skip to main content
  1. Posts/

RFC 3092: The Definitive History of 'foo' and 'bar' in Programming

··241 words·2 mins·

🤔 Why do programmers use “foo”, “bar”, and “foobar” in their examples? There is an official RFC that explains it.

RFC 3092, published on April 1, 2001 (yes, April Fools’), is an IETF document that traces the origin of the most widely used metasyntactic variables in software development.

📜 The history behind “foo”:

  • Appears in surrealist comic strips from 1930 (“Smokey Stover”)
  • In 1938, Daffy Duck holds a sign “SILENCE IS FOO!”
  • Also appears in Walt Kelly’s “Pogo”
  • During WWII, military slang “FUBAR” (Fucked Up Beyond All Repair) popularized “foobar”

📚 The standard metasyntactic variables: foo, bar, baz, qux, quux, corge, grault, garply, waldo, fred, plugh, xyzzy, thud

Over 212 prior RFCs used “foo” and “bar” without ever explaining their origin. This RFC rectifies that deficiency — with all the rigor and solemnity of the IETF 😄

🏆 Fun fact: It’s one of the few April Fools’ RFCs that became a serious reference.

💡 Explanation in a nutshell
#

A “metasyntactic variable” is a generic name used in code examples when the actual name doesn’t matter. Like saying “John Doe” or “Jane Doe” in English. “foo” and “bar” are the equivalents in technical computing, and this RFC explains where they come from.

More information at the link 👇

Also published on LinkedIn.
Juan Pedro Bretti Mandarano
Author
Juan Pedro Bretti Mandarano