Metasyntactic variable

My phrase of the day is metasyntactic variable

A metasyntactic variable is either 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.

My coworker was asking me what this foo I keep using in discussion is. So I turned to Wikipedia to give me a clear definition and background. It was listed in the Examples section of the metasyntactic variable entry under Nonesense Words.

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.
Bar, the canonical second metasyntactic variable, typically follows foo.
Baz, the canonical third metasyntactic variable, is commonly used after foo and bar.

The article also has examples via english words, people, and places. Its an entertaining read.

2 thoughts on “Metasyntactic variable”

  1. I notice Wikipedia does not mention the fourth member of the series, 25+ years ago it was “foo bar baz blee”, sometimes seen in LISP programs of the era. The origins of BAZ might have been from an exclaimation of the Pogo comic character Albert the Alligator (“Bazzle!”), modified and coined for geek use at MIT in the late 50’s, some say. Since BAZ is properly pronounced as the bleating of a sheep with the A having a duration of over 2 seconds, it could be “blee” is short for “bleat”.

Leave a Reply