The term
foobar is a common placeholder name also referred to as metasyntactic variable used in computer programming or computer related documentation.
The word "foobar" may be derived from the WW II era Army slang acronym FUBAR (`Fucked Up Beyond All Repair'), later modified to foobar and carried back by returning GIs to morph into other uses. In technology, the word was probably originally propagated through DEC system manuals by Digital Equipment Corporation or DEC in 1960s and early 1970s. Another possibility is that foobar evolved from electronics, as an inverted foo signal. This is because 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. The Jargon File makes a case that
foo possibly predates
fubar.
[ The Jargon File].
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
void foo()
void bar()
// Neither foo() nor bar() accomplish anything useful,
// and the use of either will lead to a stack overflow error
void foobar()
//Note that bar() will never be reached because of the stack overflow error
See also
- Placeholder name
- bar
- foo
- Lorem ipsum
- fubar
- foobar2000
Sources
External links
Placeholder namesPseudonyms
FoobarFoobarFoobarFoobarFoobar