Jump to content

Foo

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 130.88.199.137 (talk) at 16:41, 28 June 2007 (what has mr t got to do with foo?). 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 just to name a few. 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 like the letters 'x' and 'y' in algebra.

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.

Foo and bar paired together are apparently derived from FUBAR, but the Jargon File makes a reasonably good case that foo predates FUBAR.

Example (pseudocode)

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

When there is more than one such abstract entitity 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.

Foo is also a slang term for fool.

See Also


References

  • RFC 3092, “Etymology of ‘Foo’”