You get a bonus - 1 coin for daily activity. Now you have 1 coin

Metasyntactic Variables, Metavariables

Lecture



Metasyntactic variables, or metavariables, are placeholder words used in technical texts to denote something that could stand in their place. Metavariables are often used in programming.

Meaningful names for metavariables are usually chosen. For example, the description of a file-renaming command might look as follows:

mv source target

Here source and target are metavariables denoting the name of the file before (source) and after (target) renaming. However, words carrying no semantic meaning are also often used, foo being a typical example.

The use of metavariables in text is analogous to the use, in mathematics (and sometimes in other fields of knowledge), of the letters x, y, and z for unknown variables and a, b, and c for unknown constants. Metavariables can be regarded as variables of the metalanguage used, for example, to discuss program code, describe an algorithm, and so on.

Frequently used metavariables

Artificial words

  • foo is often used as the first metavariable to denote an unspecified (as yet) object: a function, a process, etc. The etymology of this word is also revealed in the April Fools' RFC 3092.
  • bar is used to refer to the second unspecified object in a discussion. For example, «function foo calls function bar» or «function foo(bar).»
  • the metavariable foobar, whose name is formed as a combination of foo and bar, is also often used.
  • baz is the canonical third metavariable, after foo and bar.
  • quux is the canonical fourth metavariable. Sometimes the variant qux is used for the fourth metavariable, with quux, quuux, quuuux, etc. used for the following ones.
  • bat is used by some programmers instead of quux.
  • xyzzy and plugh — magic words in the old text-based game ADVENT.
  • qwe, asd, zxc — character sets for quickly filling in text input fields (the letters in these words are adjacent on the QWERTY keyboard).

English words

  • spam and eggs are canonical metavariables used in the Python programming language. This is a reference to the well-known «Spam» sketch by the comedy group «Monty Python.»
  • needle and haystack may be used in examples explaining the syntax of commands or search functions; thanks to the idiom «looking for a needle in a haystack,» it becomes clear what is being searched for in what.

Other examples

The following are also used as metavariables: test, mum, thud, beekeeper, hoge, corge, grault, garply, waldo, kalaa, puppu, dothestuff, temp, var, sub.

Frequently used meta-numbers

  • 42 is often used as an initializer for variables when the specific value does not matter. The number is taken from Douglas Adams's work «The Hitchhiker's Guide to the Galaxy,» in which it appears as the answer to the ultimate question of life, the universe, and everything.
  • other numbers: 23, 47, 69, 666, 0815, 1337, 4711, DEADBEEF16.

The presence of such numbers in output may indicate a logical error in the program — an uninitialized variable.

Personal names

So-and-so
  • J. Random (English random) and Ned Baker are used to denote any person, or some person from a particular group, for example «J. Random User.»
  • The names Alice and Bob are used when discussing the interaction of two people, for example when describing the application of cryptographic protocols. Carol, Dave, and so on may be used to continue the series. For certain roles, traditional names are used, for example Eve is a passive attacker who can intercept data but cannot alter it, Mallory is an active attacker, and Trent is a neutral arbiter.
  • Vasya Pupkin is used in Russian-language texts.
  • John Doe is a designation for an unnamed male party in British legal proceedings. For other persons of different sex and age, similar names beginning with J are used.

Domain names

According to RFC 2606, the top-level domain .example and the second-level domains example.com, example.org, and example.net are reserved as metavariables for denoting domain names.

Organizations

  • «Horns and Hooves»
  • «Vector» LLC
  • «Romashka» LLC

Indefiniteness

  • The indefinite article (e.g. English a, an, German ein(e)) indicates that the word denotes some object without singling it out from among other such objects («one of,» «some,» «any»)
  • Variable

Computer science

  • Feecha (having nothing to do with «fishka» [gimmick], since «feecha» is the English feature, i.e. capability/functionality), fishka (a general slang term for the unusual traits of some phenomenon)

Metasyntactic Variables, Metavariables

Screenshot of the metasyntactic variable FOO, assigned and displayed in an interactive command shell.

// The function named foo
int foo(void)
{
   // Declare the variable bar and set the value to 1
   int bar = 1;

   return bar;
}

Culture

  • To Aru Majutsu no Index (and the TV series «A Certain Scientific Railgun»)
  • Ku (all the words (excluding obscenities) in the film Kin-dza-dza)
  • Mukhosransk (Exemplificant)
  • Tmutarakan
  • Kudykiny Gory
  • The middle of nowhere (see the Church of All Saints on Kulishki)
  • Town N, N-sk (Ensk))

See also

  • Common noun
  • Proper noun
  • Eponym
  • Meme
  • Etymology
  • Within the Wikipedia namespace: User:Example
  • In English-language jurisprudence: John Doe
  • Ideologeme
created: 2026-01-14
updated: 2026-03-08
25



Was this answer useful?
Choose a quick rating so we can improve the next answer for you.
How satisfied are you?


Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Lectures in Philology"

Terms: Lectures in Philology