Encyclopedia > Metasyntactic variable

  Article Content

Metasyntactic variable

In computer programming, a metasyntactic variable is a name used in examples and understood by hackers and programmers to stand for whatever thing is under discussion, or any random member of a class of things under discussion. The word foo is the canonical example.

Metasyntactic variables are so called because:

  1. they are variables in the metalanguage used to talk about programs etc (see also pseudocode);
  2. they are variables whose values are often variables (as in usages like "the value of f( foo, bar ) is the sum of foo and bar").
However, it has been plausibly suggested that the real reason for the term metasyntactic variable is that it sounds good: the term is a piece of computer jargon.

Table of contents


Foo and Bar

Foo is the first metasyntactic variable commonly used. It is sometimes combined with bar to make foobar. This suggests that foo may have originated with the World War II slang term fubar, as an acronym for fucked up beyond all recognition. Foo was also used as a nonsense[?] word in the surrealistic comic strip Smokey Stover[?] that was popular in the 1940s and 1950s. See also Foo Fighters for more foo etymology.

The jargon file has an extensive etymology of the word foo at [1] (http://www.catb.org/~esr/jargon/html/F/foo). The IETF also published a memo on the subject: see RFC 3092 (http://www.ietf.org/rfc/rfc3092.txt?number=3092).


baz is the third metasyntactic variable, commonly used after foo and bar.

Fred & Barney

After the characters in the cartoon series The Flintstones.


xyzzy is from the Colossal Cave Adventure

Other examples

quux, mum, thud, beekeeper, hoge, corge, grault, garply, waldo, plugh.

An earlier version of the above paraphrased a Jargon File article here (http://www.catb.org/~esr/jargon/html/M/metasyntactic-variable).

All Wikipedia text is available under the terms of the GNU Free Documentation License

  Search Encyclopedia

Search over one million articles, find something about almost anything!
  Featured Article
Reformed churches

... Church of Nigeria[?] - (Scottish Presbyterian) Qua Iboe Church[?] - (Northern Irish Presbyterian) Church of Christ in the Sudan among the Tiv[?] - (Dutch Reformed) ...

This page was created in 105.6 ms