Jump to content

Foo

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 150.101.209.72 (talk) at 00:25, 4 September 2008. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Foo is a metasyntactic variable used heavily in computer science to represent concepts abstractly and can be used to represent any part of a complicated system or idea including the data, variables, functions, and commands. Foo is commonly used with the metasyntactic variables bar and foobar.

The word foo itself has no meaning and is merely a commonly used logical representation that is used much in the way that the letters and are used in algebra to represent a number. In computer programming metasyntactic variables such as foo are used as a variable to represent the name of a subroutine, variable, or any other programmer named part of a program.

Foo has entered the English language as a neologism due to its popularity in describing concepts in computer science and is considered by many to be the canonical example of a metasyntactic variable. It is used extensively in computer programming examples and pseudocode. Eric S. Raymond has called it an "important hackerism" alongside kludge and cruft.[1]

Foo and bar paired together are apparently derived from FUBAR, but the etymology of the term "foo" is explored in the internet Request for Comments 3092, which notes usage of "foo" in 1930s cartoons including The Daffy Duck and comic strips, especially Smokey Stover and Pogo. From there the term migrated into military slang, where it merged with FUBAR.[2]

FOO as an abbreviation of Forward Observation Officer was a British Army term in use as early as the First World War[3] The term has been adopted in other contexts. $foo is the name of a Perl programming magazine,[4] and Foo Camp is an annual hacker convention (the name is also a backronym for Friends of O'Reilly, the event's sponsor).

Example (pseudocode)

There are two functions: FOO and BAR
 FOO calls function BAR 
 BAR returns the data FOOBAR

When there is more than one such abstract entity to reference, the terms bar and baz or foobar are also usually used to refer to the second and third entities, respectively, as shown above. (In other words, the term 'bar' implies the existence of a primary entity 'foo', and so on.)

The placeholders make this a template for any program fragment wherein one function calls another which returns data to the first.

Microsoft anti-trust lawsuit

During the United States v. Microsoft trial, some evidence was presented that Microsoft had tried to use the Web Services Interoperability organization as a means to stifle competition included e-mails in which top executives including Bill Gates referred to the WS-I using the codename "foo".[5]

See also

Notes

  1. ^ Eric S. Raymond (1996). The New Hacker's Dictionary. MIT Press. ISBN 0262680920.
  2. ^ D. Eastlake III; et al. (2001). "Etymology of "Foo"". Internet Engineering Task Force. Retrieved 2007-11-05. {{cite web}}: Explicit use of et al. in: |author= (help)
  3. ^ http://www.1914-1918.net/Diaries/wardiary-118siege.htm Extract from War Diary of 118th Siege Battery WO95/322
  4. ^ $foo PERL MAGAZIN Template:De icon
  5. ^ Microsoft ploy to block Sun exposed