Metasyntactic Variable

Definition - What does Metasyntactic Variable mean?

Metasyntactic variables are a type of variable used by application developers as a placeholder name or alias term that is unlike more commonly used logical variables. Such a variable can consist of any symbol or word used that doesn't violate the rules of the language, though metasyntactic variables are usually nonsensical words that usually selected for uniqueness.

Techopedia explains Metasyntactic Variable

Variable name creation is challenging, especially for programmers who teach specific programming language syntax or algorithms. Metasyntactic variable naming is used a temporary solution that provides greater clarity than random letters or words.

The following are examples of common metasyntactic variables:

  • MIT/Stanford: foo, bar, baz, guux
  • CMU: foo, bar, thud, grunt
  • Python programmers: spam, ham eggs
  • Common in England: o oogle, foogle, boogle o zork, gork, bork

Of all meta-syntactic variables, "foo" is the most common.

Popular White Papers

Techopedia Newsletter Sign-Up

Get Techopedia delivered to your inbox!