metasyntactic variables

from wikipedia, the free encyclopedia.

a metasyntactic variable can either be a placeholder name, a kind of alias term, commonly used to denote the subject matter under discussion, or a random member of a class of things under discussion.

the term originates from computer programming and other technical contexts, and is commonly used in examples by hackers and programmers.

the use of a metasyntactic variable is helpful in freeing a programmer from creating a logically named variable, although the invented term may also become sufficiently popular and enter the language as a neologism. the word foo is the canonical example.

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. “widgets” are also used in business to indicate an as-yet-unspecified product and are frequently sold by the acme company.

metasyntactic variables are so called because:

  • they are variables in the metalanguage used to talk about programs, etc.
          see also pseudocode
  • they are variables whose values are often variables as in usages like
          the value of ƒ ( foo, bar ) is the sum of foo and bar

examples

→  nonsense words →  english words →  numbers
→  names of people →  military names →  other names
→  place names →  other languages

nonsense words

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).

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/repair, although the wikipedia jargon file makes a reasonably good case that foo predates fubar.

foo was also used as a nonsense word in the surrealistic comic strip smokey stover that was popular in the 1940s and 1950s.

another usage of foo is as an abreviation of the phrase “forward observation officer” (or observer). apparently foos used to go places well forward of normal troops in battle and leave a stylised chalk graffiti of a person looking over a wall with the words “foo was here”.

the term “kung foo” has come to mean skill in computer programming. this is actually used (though misspelled) in the movie the core.

bar, the canonical second metasyntactic variable, typically follows foo.

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

foo, bar, and baz are often compounded together to make such words as foobar, barbaz, and foobaz.

quux
quux, introduced by guy l. steele, jr., is the canonical fourth metasyntactic variable, commonly used after baz. however, more recently qux has become more common as the fourth variable, displacing quux as the fifth. a probable reason for this is that quux is often followed by the series quuux, quuuux, quuuuux etc. and qux fits this pattern perfectly.
bat
bat is used by some programmers as an alternative to quuux.
xyzzy
the word xyzzy is the “magic word” from the colossal cave adventure, and therefore is often used as a metasyntactic variable, especially by old-school hackers.
shme
infrequently used in various environments such as berkeley, geoworks, ingres, quovadx. pronounced /shmeh/ with a short /e/.

→ return to contents list

english words

spam and eggs
spam and eggs are the canonical metasyntactic variables used in the python programming language. this is a reference to a famous comedy sketch by monty python, after which the language is named.
needle and haystack
needle and haystack are commonly used in computer programming to describe the syntax of functions that involve a search parameter and a search target, such as searching a substring within a string; with these two words, derived from the idiom “to find a needle in a haystack”, it is clearer where the substring for which to search goes, and where the string in which to search goes. this can be seen, for instance, in the documentation for some functions in the computer language php.
other words used as metasyntactic variables include:
  • beekeeper
  • blah
  • blarg
  • bleh
  • corge
  • doip
  • dothestuff
  • garply
  • glarb
  • grault
  • hoge
  • kalaa
  • mum
  • plugh
  • puppu
  • stuff
  • sub
  • temp
  • test
  • thud
  • var
  • waldo
  • momo.

→ return to contents list

numbers

23
the number 23 is also commonly used as an integer example—particularly when the connotations associated with 42 are undesirable.
42
the number 42 is often a common initializer for integer variables, and acts in the same vein as a “metasyntactic value”. it is taken from douglas adams’ the hitchhiker’s guide to the galaxy, where deep thought concluded that it was the answer to life, the universe, and everything.
47
the number 47 is sometimes used instead of 42 above, and is used mainly by members of the 47 society, or new trek fans.
69
69 is often used as an example number. popular among hackers as an addition to metasyntactic variables (foo69, bar69), also used in all sorts of hacks. 69 is popular because of its reference to a sexual position. it is also because it is the largest number whose factorial can be calculated by a pocket calculator limited to standard scientific notation with a 2 digit exponent.
0815
0815 (named after the repetitive and boring mg 08/15-training) is used in german as either a random number or to reflect something normal or boring.
1337
stands for leet, in leetspeak, being, thus, commonly used.
4711
4711 is most commonly used in german computer speak as a random member of a set. it is a brand of eau de cologne, originally named after the number of the manufacturer’s house in cologne.

→ return to contents list

names of people

j. random and ned baker
j. random and ned baker are the names of archetypal users.
j. random hacker and j. random user are also common.
alice and bob
alice and bob are names of the archetypal individuals used as examples in discussions of cryptographic protocols. others include:
  • carol - a participant in three- and four-party protocols
  • dave - a participant in four-party protocols
  • ellen - a participant in five- and six-party protocols
  • frank - a participant in six-party protocols, and so on
  • eve or oscar - an (evil) eavesdropper
  • mallory or mallet - a malicious active attacker
  • trent - a trusted arbitrator
  • walter - a warden
  • peggy - a prover
  • victor - a verifier
  • sam - a trusted server (uncle sam)
  • charlie - a challenger or opponent
  • trudy - an intruder or malicious entity

bob, alice and carol may have come from the 1969 movie bob & carol & ted & alice, or from the fact that they are common english names starting with a, b and c, the first letters of the alphabet.

dave, ellen, and frank are the next three letters.

some people continue this pattern, using gloria or another similar term for the seventh participant, and so on (maintaining the pattern female, male, female, male …).

fred and barney

after the characters in the cartoon series the flintstones.

the most famous use of these is the example code in learning perl.

fred is also known to have been used simply because the keys are close together on the qwerty keyboard.

→ return to contents list

military names

some names are most commonly used in military context.

private snuffy
susie rottencrotch or jane rottencrotch
from the movie full metal jacket
gi joe or gi jane
beetle bailey from the comic strip of the same name
gomer pyle or private pyle
from the television show of the same name,
also popularized by the movie full metal jacket

→ return to contents list

other names

sometimes placeholders from other contexts will be used:

  • john doe
  • jane roe
  • richard roe
  • a. n. other
  • john q. public
  • bloggs or joe bloggs
  • joe soap and tom
  • dick and harry.
law schools
  • the generic case name push v. pull is used as a variable.
law or accounting firms
  • sometimes referred to with names like dewey cheatham & howe
  • ie. do we cheat ‘em and how!
other nonsense names
  • come from swapping initials e.g. j. pennings.

→ return to contents list

place names

smallville and metropolis
smallville and metropolis are fictional places from the superman series of comic books.
these are used to contrast urban and rural characteristics.
anywhere, anytown and nowhere
anywhere, usa or anytown, usa connotes genericness.
nowhere sometimes suggests that the entry is invalid.
middle of nowhere / in the sticks / east buttfuck / east boofu
unlike nowhere, these metasyntactic variables indicate extreme remoteness
and suggest contempt.
podunk university
this term is sometimes a placeholder for a generic university.
y.u. bum university
this term is sometimes a placeholder for a less generic university.
pronounced like “why you bum, you.”

→ return to contents list

other languages

of course, other languages have their own metasyntactic variables.
some examples:

→  chinese →  danish →  dutch →  italian
→  italian (suisse) →  french →  greek →  japanese
→  yiddish →  portuguese →  finnish →  estonian
→  german →  romanian →  french (belgium) →  turkish
→  spanish →  hebrew →  tamil →  hungarian
→  hindi →  russian →  swedish →  notes
chinese

jia
yi
bing
ding

→ language list

danish

flaf
giraf
boing

→ language list

dutch

aap
noot
mies
piet
jan
kees

→ language list

italian

pippo1
pluto1
paperino1

→ language list

italian (suisse)

maria bernasconi

→ language list

french

toto
tata
titi
prout
banane

→ language list

greek

koko
lala
malakia

→ language list

japanese

hoge
hogehoge
moge
huga
piyo

→ language list

yiddish

peh
meh
shmeh

→ language list

portuguese

bla
nha
la
patati
patata
fulano2
sicrano2
beltrano2

→ language list

finnish

huu
haa
hahaa
hihii
hohoo

→ language list

estonian

kala3
kalatehas4
oxe5

→ language list

german

muh
bla
blubb
schlurps
schnurz
lieschen mueller

→ language list

romanian

bubu
mumu
zeze

→ language list

french (belgium)

brol
prout

→ language list

turkish

filan
hede
hödö
zıvır
ıvır
bok
püsür
ali
veli
deli

→ language list

spanish

fulano6
mengano6
zutano6
sultano7
pepe8
pp9
vaina10
cosa11
pirola12
pirolita13

→ language list

hebrew

14 פלוני
15 ראובן & שמעון

→ language list

tamil

kuppuswamy
ramaswamy

→ language list

hungarian

gipsz jakab
alma
körte
barack

→ language list

hindi

phalaan phalaan

→ language list

russian

Вася Пупкин 16
рядовой Пупкин) 17

→ language list

swedish

bla
blahuj
ugg
ugga
blargh
gunk
tjo
bork
kalle18
olle18
pelle18
nisse18

→ language list

notes

  1. italian names of the disney characters goofy, pluto and donald duck
  2. placeholders for persons’ names
  3. fish
  4. fish factory
  5. vomit (misspelt)
  6. a supposed or fictional person
  7. variant of “zutano”
  8. as "joe" is used in english
  9. phonetic equivalent to “pepe”
  10. vulgar
  11. can be anything; usually refers to a physical object
  12. has no meaning
  13. diminutive of pirola; has no meaning
  14. “ploni”; a person’s name
  15. “reuven and shim’on”; two persons, after jacob’s sons
  16. “vasya pupkin”, an abstract person
  17. “private pupkin”; an abstract soldier (or programmer)
  18. diminutives of karl, olaf, per and nils

→ return