Misplaced Pages

Foobar

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

This is an old revision of this page, as edited by Draicone (talk | contribs) at 14:12, 6 July 2007 (Examples: Fix syntax and wikicode). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Revision as of 14:12, 6 July 2007 by Draicone (talk | contribs) (Examples: Fix syntax and wikicode)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff) For other uses, see Foobar (disambiguation).Not to be confused with FUBAR.

Foobar is a common placeholder name also referred to as metasyntactic variable used in computer programming or computer related documentation.

Etymology

  • Probably originally propagated through DECsystem manuals by Digital Equipment Corporation (DEC) in 1960s and early 1970s; confirmed sightings there go back to 1972. Hackers do not generally use this to mean FUBAR in either the slang or jargon sense.
  • Evolved from electronics, as an inverted foo signal; if a digital signal is active low (so a negative or zero-voltage condition represents a "1") then a horizontal bar is commonly placed over the signal label.
  • In RFC1639, “FOOBAR” was made an abbreviation for “FTP Operation Over Big Address Records”, but this was an obvious backronym.
  • Term used by IT consultants referring to irrelevant and redundant requests from incompetent employees. (Also see "6th Floor")

The Jargon File makes a reasonably good case that foo predates fubar.

It is also possible that these two come from physics.

Examples

The Term Foobar or Foo and Bar separately are very often used in programming examples, much like the Hello World program is commonly used as an introduction.

Here is an example of how foo and bar might be used to illustrate a simple string concatenation:

// PHP code
$foo = 'Hello';
$bar = 'World';
$foobar = $foo . ' ' . $bar;
// $foobar now contains the string "Hello World"

//C# code
public static void foo()
{
    bar();
}
public static void bar()
{
    foo();
}
// Neither foo() nor bar() accomplish anything useful, 
// and the use of either will lead to a stack overflow error


See also

Sources

  1. The Jargon File

External links

Categories: