I've always wanted to know what the foo, bar, baz, etc... names mean.
Several times I've found these terms in scientific articles. Furthermore this terminology in some way serves as a standard for other exemplifications.
Does anyone know where these terms come from, and how to use them properly?
Foo bar baz are placeholder names used in computer programming to fill in for unknown, flexible, or as-yet undecided variables, including events or processes. For example, when building code, one process might call up another, stated in computer jargon as “foo calls bar.”
Both "foo" and "bar" (and even "baz") were well known in popular culture, especially from Smokey Stover and Pogo comics, which will have been read by many TMRC members. Also, it seems likely the military FUBAR contributed to their popularity.
“Foo” and “bar,” along with “baz,” “qux,” and “quux,” in that order, followed less strictly by “corge,” “grault,” “garply,” “waldo,” “fred,” “plugh,” “xyzzy,” and “thud,” among others, are used as placeholder names in program code that may be sketched quickly and may be intended to be provisional, demonstrative, ...
Foo and bar are simply arbitrary names for methods, classes, variables, etc. for when showing examples of programming syntax. They came from the word "fubar", an acronym for "effed up beyond all recognition".
While this question borders on being outside the scope of Stack Overflow, I highly recommend the Wikipedia article on the matter:
The History of Foobar
To give a quick preview:
The word foo originated as a nonsense word from the 1930s, the military term FUBAR emerged in the 1940s... The term foo fighter was used by Allied aircraft pilots in World War II to describe various UFOs or mysterious aerial phenomena. The first known use of the terms in print in a programming context appears in a 1965 edition of MIT's Tech Engineering News.
The terms foobar (/ˈfuːbɑːr/), foo, bar, baz, and others are used as metasyntactic variables and placeholder names in computer programming or computer-related documentation. They have been used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept.
Foobar Wikipedia article
Foo, bar, and other terms are used as placeholder names to demonstrate a concept. In real life, these values are usually substituted with more meaningful names that fit the context of your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With