Product Code Database
Example Keywords: e-readers -leather $36-128
   » » Wiki: Foobar
Tag Wiki 'Foobar'.

The terms foobar (), or foo and others are used as (also referred to as metasyntactic variables) in computer programming or computer-related documentation. They have been used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept.

History and etymology
The etymology of foo is obscure. Its use in connection with bar is generally traced to the World War II FUBAR, later to foobar. The word foo on its own was used earlier. Between about 1930 and 1952 it appeared in the comic by Bill Holman, who stated that he used the word due to having seen it on the bottom of a jade Chinese figurine in Chinatown, San Francisco, purportedly signifying "good luck". This may be related to the Chinese word fu ("福", sometimes transliterated foo), which can mean happiness or blessing.

The first known use of the terms in print in a programming context appears in a 1965 edition of MIT's Tech Engineering News. Foobar may have come about as a result of the pre-existing "Foo" being conjoined with "bar", an addition borrowed from the military's FUBAR. The use of foo in a programming context is generally credited to the Tech Model Railroad Club (TMRC) of MIT from circa 1960. In the complex model system, there were switches located at numerous places around the room that could be thrown if something undesirable was about to occur, such as a train going full-bore at an obstruction. Another feature of the system was a digital clock on the dispatch board. When someone hit a scram switch, the clock stopped and the display was replaced with the word "FOO"; at TMRC the scram switches are, therefore, called "Foo switches". Because of this, an entry in the 1959 Dictionary of the TMRC Language went something like this: "FOO: The first syllable of the misquoted sacred chant phrase 'foo mane padme hum.' Our first obligation is to keep the foo counters turning.", One book describing the MIT train room describes two buttons by the door: labeled "foo" and "bar". These were general purpose buttons and were often re-purposed for whatever fun idea the MIT hackers had at the time, hence the adoption of foo and bar as general purpose variable names. An entry in the Abridged Dictionary of the TMRC Language states:

The term foobar was propagated through computer science circles in the 1960s and early 1970s by system manuals from Digital Equipment Corporation. Foobar was also used as a variable name in the code of Colossal Cave Adventure (1977 Crowther and Woods version). The variable FOOBAR was used to contain the player's progress in saying the magic phrase "Fee Fie Foe Foo".

Example use in code
In this code sample in C, foo and bar are used to illustrate string concatenation:

  1. include

int main() {

  const char *foo = "Hello";
  const char *bar = "World!";
  fprintf(stdout, "%s %s\n", foo, bar);

  return 0;

; scheme code

(define foobar

  (lambda (x)
     (display x)))
(foobar "Hello World!")

Examples in language
  • is an annual hacker convention.
  • , an international network of user generated conferences
  • During the United States v. Microsoft Corp. trial, some evidence was presented that Microsoft had tried to use the Web Services Interoperability organization as a means to stifle competition, including e-mails in which top executives including referred to the WS-I using the codename "foo". Microsoft ploy to block Sun exposed,
  • foobar2000 is an audio player.
  • Google uses a web tool called to recruit new employees.
  • is an American rock band named after the , unidentified flying objects reported by World War II pilots.
  • Stanley Black & Decker has registered the fubar, used as branding for a type of crowbar.

See also

External links

Page 1 of 1
Page 1 of 1


Pages:  ..   .. 
Items:  .. 


General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 


Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs
1s Time