Searching for the Origins of “foobar”
While reading programming books and online resources, I often come across the all-purpose placeholder terms “foo”, “bar”, and “baz” in code examples. For the non-programmers out there, these terms are used to name entities such as variables, functions, and commands in order to demonstrate a concept.
I was curious about the origins of these terms and did some investigative research (i.e. looked it up on Wikipedia). What I found was pretty interesting.
Foo first originated as a nonsense word in the 1930s when it appeared in a comic called Smokey Stover by Bill Holman who stated that he used the word after seeing it on the bottom of a jade figurine in Chinatown, San Francisco. The Chinese word transliterated as “fu” means good luck.
The term then evolved into military slang in the 1940s, merging with the term FUBAR, which stands for “F**ked Up Beyond All Repair.” During WWII, the term ‘foo fighters’ was used to describe UFOs (so that’s where the Foo Fighters got its name!).
The use of foo in a programming context may have begun in the 1960s by the Tech Model Railroad Club (TMRC), a student organization that built model trains and systems. The term foobar first appeared in system manuals by Digital Equipment Corporation in the 1960s and early 1970s.
The exact relationships between foo, FUBAR, and foo/bar in a programming context are not known with certainty but anecdotal theories abound. You can learn more about the etymology of foo in the Internet Engineering Task Force (IETF) RFC 3092. It’s pretty interesting reading.