foo, bar , baz, foonley are metasyntactic variables.
metasyntactic variables are used in formal
logic, and used in spoken languages
A metasyntactic variable is a specific word or
set of words identified as a placeholder in computer science and
specifically computer programming. These words are commonly found in source
code and are intended to be modified or substituted to be applicable to
the specific usage before compilation (translation to an executable).
The words foo and bar are good
examples as they are used in over 330 Internet Engineering Task Force Requests
for Comments, which are documents explaining foundational internet technologies
like HTTP (websites), TCP/IP, and email protocols.
By mathematical analogy, a metasyntactic variable is a word
that is a variable for other words, just as in algebra letters
are used as variables for numbers.
Metasyntactic variables are used to name entities such as
variables, functions, and commands whose exact identity is unimportant and
serve only to demonstrate a concept, which is useful for teaching programming.
Due to English being the foundation-language, or lingua franca, of most
computer programming languages these variables are commonly seen even in
programs and examples of programs written for other spoken-language audiences.
The typical names may depend however on the subculture that has
developed around a given programming language.
General usage
Metasyntactic variables used commonly across all programming
languages include foobar, foo, bar, baz, qux, quux, quuz, corge, grault, garply, waldo, fred, plugh, xyzzy, thud,
Wibble, wobble, wubble, and flob are
also used in the UK.
A complete reference can be found in a MIT Press book
titled The Hacker's Dictionary.
No comments:
Post a Comment