Index: > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Business Industries Finance Tax

Home > Metasyntactic variable


First Prev [ 1 2 3 ] Next Last

In computer programming, a metasyntactic variable is a kind of alias, a name commonly 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. The use of metasyntactic variables is also helpful in that they free the programmer from having to think up a logically named variable for the topic under discussion.

The phenomenon is similar to the use in algebra of x, y and z for unknown variables, and a, b and c for unknown constants.

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.

1 Examples

1.1 Nonsense words

1.1.1 Foo, Bar and Baz

Foo is the first metasyntactic variable, commonly used to represent an as-yet-unspecified term, value, process, function, destination or event but seldom a person (see Ned Baker, below). 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/fouled up beyond all recognition, although the Jargon FileThe Jargon File is a compendium of hacker jargon. The original Jargon File was a collection of hacker jargon from technical cultures including the MIT AI Lab, the Stanford AI Lab (SAIL), and others of the old ARPANET AI/ LISP/ PDP-10 communities including makes a reasonably good case that foo predates fubar. Foo was also used as a nonsenseNonsense is an utterance or written text in what appears to be a human language or other symbolic system, that does not in fact carry any identifiable meaning. Distinguishing sense from nonsense While Emily Dickinson wrote that: Much madness is divinest S word in the surrealisticSurrealism is a movement for the liberation of the mind that emphasizes the critical and imaginative powers of the unconscious. Often misinterpreted as an artistic movement, it has transformed visual art, writing, film, music, and political thought, not t comic stripThis article is about the comic strip, the sequential art form as published in newspapers and on the Internet. There is a separate article about The Comic Strip, the British comedy group. A comic strip is a short strip or sequence of drawings, telling a s Smokey StoverSmokey Stover was a semi-surreal newspaper comic strip drawn by Bill Holman from March 10, 1935 until he retired in 1973, and distributed through the Chicago Tribune''. It featured Smokey the firefighter, in his two-wheel firetruck called "The Foomobile", that was popular in the 1940sCenturies: 19th century 20th century 21st century Decades: 1890s 1900s 1910s 1920s 1930s 1940s 1950s 1960s 1970s 1980s 1990s Years: 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 Events and trends Technology First nuclear bomb First cruise missile, the and 1950sCenturies: 19th century 20th century 21st century Decades: 1900s 1910s 1920s 1930s 1940s 1950s 1960s 1970s 1980s 1990s 2000s Years: 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 Events and trends Technology United States tests the first fusion bomb.. It appears to be unrelated to Kung fuAlternative meaning: Kung Fu (TV series Kung fu or gongfu (, pinyin: gongfu) is a well-known Chinese term used in the West to designate Chinese martial arts. Its original meaning is somewhat different, referring to one's ability in any skill, not necessar. See also Foo fighter for more foo etymology, as well as RFC 3092.

Bar, the canonical second metasyntactic variable. Typically follows foo.

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





Non User