foobar

{{Short description|Placeholder names in programming}}

{{Distinguish|FUBAR|foobar2000|FUBAR (TV series)}}

{{Redirect|Foo|other uses|Foo (disambiguation)|the acronym|FOO}}

File:TC-dbl.PNG]]

{{Use dmy dates|date=February 2020|cs1-dates=y}}

The terms foobar ({{IPAc-en|ˈ|f|uː|b|ɑr}}), foo, bar, baz, qux, quux,{{Cite web |editor-last=Eric S. Raymond |title=The on-line hacker Jargon File, version 4.4.8. metasyntactic variable |url=http://www.catb.org/jargon/html/M/metasyntactic-variable.html |access-date=2024-05-30 |website=Jargon File}} and others are used as metasyntactic variables and placeholder names in computer programming or computer-related documentation.{{IETF RFC|3092}} - Etymology of "Foo" 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.

The style guide for Google developer documentation recommends against using them as example project names because they are unclear and can cause confusion.{{cite web |title=Example domains and names {{!}} Google developer documentation style guide |url=https://developers.google.com/style/examples#example-project-names |website=Google for Developers |access-date=26 June 2023 |language=en |date=2023-06-23 |quote=Ensure that the name is applicable to the user's environment. Don't use unclear terms like foo, bar, and baz.}}

History and etymology

It is possible that foobar is a playful allusion to the World War II-era military slang FUBAR (fucked up beyond all recognition).{{Cite web|url=https://www.dictionary.com/e/foo/|title=What does foo mean?|publisher=Dictionary.com|access-date=2019-08-17}}

According to a RFC from the Internet Engineering Task Force, the word FOO originated as a nonsense word with its earliest documented use in the 1930s comic Smokey Stover by Bill Holman.{{cite web|last1=Eastlake|first1=D|last2=Manros|first2=C|last3=Raymond|first3=E|title=Etymology of "Foo"|url=http://www.ietf.org/rfc/rfc3092.txt|website=The Internet Engineering Task Force|accessdate=17 April 2016}} Holman states that he used the word due to having seen it on the bottom of a jade Chinese figurine in San Francisco Chinatown, purportedly signifying "good luck".{{Cite web|url=https://www.smokey-stover.com/history.html|title=The History of Bill Holman|date=2007-06-13|publisher=Smokey Stover|access-date=2019-08-17}} If true, this is presumably related to the Chinese word fu ("{{lang|zh|福}}", sometimes transliterated foo, as in foo dog), which can mean happiness or blessing.Mieke Matthyssen, "Chinese happiness: A proverbial approach to popular philosophies of life", p. 190, ch. 9 in, Gerda Wielander, Derek Hird (eds), Chinese Discourses on Happiness, Hong Kong University Press, 2018 {{ISBN|9888455729}}.

The first known use of the terms in print in a programming context appears in a 1965 edition of MIT's Tech Engineering News.{{cite book|url=https://books.google.com/books?id=aOQRAQAAMAAJ&q=foobar|title=Tech Engineering News|volume=47|year=1965|publisher=Massachusetts Institute of Technology|page=63|quote=Further, it is possible to search for an effective address; e.g., if an instruction such as "add 1 foo" were used, specifying indirect addressing thru location "foo", and location "foo" contained the address of location "foobar", then an effective word search for "foobar" would find location "foo" and the location containing the "add" instruction as well.}} The use of foo in a programming context is generally credited to the Tech Model Railroad Club (TMRC) of MIT from {{circa|1960}}. In the complex model system, there were scram switches located at multiple places around the room that could be thrown if something undesirable was about to occur, such as a train moving at full power towards an obstruction. Another feature of the system was a digital clock on the dispatch board. When someone hit a scram switch, the clock stopped and the display was replaced with the word "FOO"; at TMRC the scram switches are, therefore, called "Foo switches". Because of this, an entry in the 1959 Dictionary of the TMRC Language went something like this: "FOO: The first syllable of the misquoted sacred chant phrase 'foo mane padme hum.' Our first obligation is to keep the foo counters turning."{{cite web|url=https://www.computer-dictionary-online.org/definitions-f/foo.html|title=Computer Dictionary Online}}, computer-dictionary-online.org One book{{which|date=November 2010}} describing the MIT train room describes two buttons by the door labeled "foo" and "bar". These were general-purpose buttons and were often repurposed for whatever fun idea the MIT hackers had at the time, hence the adoption of foo and bar as general-purpose variable names. An entry in the Abridged Dictionary of the TMRC Language states:{{cite web|url=http://tmrc.mit.edu/dictionary.html#FOO|title=Abridged Dictionary of the TMRC Language|publisher=Tech Model Railroad Club of MIT|access-date=2013-03-12|archive-url=https://web.archive.org/web/20180102215225/http://tmrc.mit.edu/dictionary.html#FOO|archive-date=2 January 2018|url-status=dead}}

{{Blockquote|text = Multiflush: stop-all-trains-button. Next best thing to the red door button. Also called FOO. Displays "FOO" on the clock when used.}}

Foobar was used as a variable name in the Fortran code of Colossal Cave Adventure (1977 Crowther and Woods version). The variable FOOBAR was used to contain the player's progress in saying the magic phrase "Fee Fie Foe Foo", a phrase from an historical quatrain in the classic English fairy tale Jack and the Beanstalk. Intel also used the term foo in their programming documentation in 1978.

Examples in culture

| url=https://www.cnet.com/news/microsoft-ploy-to-block-sun-exposed/

| title=Microsoft ploy to block Sun exposed

| date=2002-07-04

| author=Mike Ricciuti

| publisher=CNET

| access-date=2019-08-17}}

See also

{{Portal|Computer programming}}

{{Clear}}

References

{{Reflist|refs=

{{cite book |title=MCS-86 Assembler Operating Instructions For ISIS-II Users |id=Manual Order No. 9800641A |date=1978 |edition=A32/379/10K/CP |publisher=Intel Corporation |location=Santa Clara, California, USA |url=https://archive.org/details/bitsavers_intelISISIblerOperatingInstructionsforISISIIUsersM_3593319/ |access-date=2020-02-29}} [https://archive.org/stream/bitsavers_intelISISIblerOperatingInstructionsforISISIIUsersM_3593319/9800641A_MCS-86_Assembler_Operating_Instructions_for_ISIS-II_Users_Mar79_djvu.txt][https://archive.org/download/bitsavers_intelISISIblerOperatingInstructionsforISISIIUsersM_3593319/9800641A_MCS-86_Assembler_Operating_Instructions_for_ISIS-II_Users_Mar79.pdf]

}}