ArticleslgStudy

computer science

Foobar

Foobar is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Foobar rather than just read about it. In short: The terms foobar, foo, bar, boom, baz, quux, and others are used as metasyntactic variables 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 — main illustration
Foobar — illustration

Key takeaways

  • Foobar belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Foobar to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Foobar from memory before moving on to harder problems.

Reference excerpt

The terms foobar, foo, bar, boom, baz, quux, and others are used as metasyntactic variables 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.

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). According to an 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. 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". If true, this is presumably related to the Chinese word fu ("福", sometimes transliterated foo, as in foo dog), which can mean happiness or blessing. 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 use of foo in a programming context is generally credited to the Tech Model Railroad Club (TMRC) of MIT from c. 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 stated: "FOO: The first syllable of the misquoted sacred chant phrase 'foo mane padme hum.' Our first obligation is to keep the foo counters turning." One book 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:

Multiflush: stop-all-trains-button. Next 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 a 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 Foo Camp is an annual hacker convention. BarCamp, an international network of user-generated conferences. During the United States v. Microsoft Corp. trial, evidence was presented that Microsoft had tried to use the Web Services Interoperability organization (WS-I) as a means to stifle competition, including e-mails in which top executives including Bill Gates and Steve Ballmer referred to the WS-I using the codename "foo". foobar2000 is an audio player.

See also

Alice and Bob Foo fighter Foo was here Lorem ipsum, similar placeholder text used outside programming xyzzy Category:Variable (computer science)

Notes

References

External links Google developer documentation style guide word list The Jargon File entry on "foobar", catb.org RFC 1639 – FTP Operation Over Big Address Records (FOOBAR)

Illustrations

Foobar: Foobar being used to show transclusion
Foobar being used to show transclusion

Worked examples

Example 1 — a first encounter with Foobar

Start with the simplest possible case. Write down what Foobar claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Foobar before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Foobar ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Foobar

In research
Foobar appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Foobar in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Foobar is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer programming folklore, Computing terminology, Placeholders, so understanding it makes those chapters shorter.
In everyday life
Look for Foobar outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Foobar” →

How to study Foobar in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Foobar means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Foobar out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Foobar in simple terms?

The terms foobar, foo, bar, boom, baz, quux, and others are used as metasyntactic variables 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…

Why does Foobar matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Foobar?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Foobar.

Tags

  • Computer programming folklore
  • Computing terminology
  • Placeholders

Keep exploring