Examples of foo
Examples of foo
Where does foo come from?
Foo is a nonsense word used especially in computer programming when someone wants to demonstrate a concept but using a common word (such as apple or dog) might be misleading due to real-world associations with them. Foo, instead, focuses attention on the computer science process at hand, rather than the content of the particular example being used to illustrate it. Other related terms include bar, foobar, and quux. The field of linguistics uses similar placeholder words, like wug, as does the field of economics with widget.
The word foo goes back to a comic strip named Smokey Stover by Bill Holman, which ran from the 1930s to the 1950s. In the comic, the main characters drove a two-wheeled fire truck called the “Foo Mobile.” In the strip, Holman also variously incorporated foo in playful expressions (“He who foos last foos best”) and colorful inventions (“confoogration”). Holman is said to define foo as “good luck,” based on the Chinese fu, “happiness.”
Foo was used as nonsense word in many contexts throughout the 1940s and 1950s, often with wildly different meanings. In WWII, pilots witnessed an unidentified flying object (UFO) that resembled a ball of fire, which they dubbed “foo fighters,” based on one Stover’s catchphrases, “Where’s there’ foo, there’s fire.” Popular American rock band the Foo Fighters took their name from the term.
Foo’s link to computer programming goes back to 1959, when the term was used, apparently in reference to Holman’s nonsense foo, by MIT’s Tech Model Railroad Club (TMRC), which sarcastically defined it as “the sacred syllable.” The TMRC developed a complex train model system that could be halted by various shutdown mechanisms if it risked crashing into something. When one of these shutdown switches was used, the word “foo” would display, leading to them being called foo switches. The room also had two buttons by the door, one labeled foo and the other labeled bar, also helping to popularize bar and foobar as programming placeholders. In the following decades, the terms gained increased use throughout the 1960s and 1970s because they appeared in widely distributed systems manuals printed by the Digital Equipment Corporation.
Who uses foo?
Foobar is not equivalent to the WWII military term FUBAR, an acronym for “Fucked Up Beyond All Recognition.” Though it’s possible that the linking of foo and bar might have grown out of familiarity with and playful allusion to FUBAR, programmers using foobar do not use it in this sense.
“Foo was here” was a popular piece of graffiti drawn by Australian soldiers in WWII, and possibly even WWI, that depicts a little man poking his head and large nose over the wall à la Kilroy. While the origins of this foo are unclear, it appears to be unrelated to Holman’s foo.
Foo’ is sometimes also used as a shortening of fool in English dialects, often a reference to the way the word was said by Mr. T in The A-Team. This has no connection to the programming term.