foobar
From Wikipedia, the free encyclopedia
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.[1].
Contents |
[edit] 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() { bar(); } void bar() { foo(); } // Neither foo() nor bar() accomplish anything useful, // and the use of either will lead to a stack overflow error void foobar() { foo(); bar(); }
[edit] See also
[edit] Sources
[edit] External links
- The Jargon File entry on foobar
- RFC 3092 - Origin and usage of foobar
- Foobar2000 is an advanced audio player for the Windows platform
- RFC 1639 - FTP Operation Over Big Address Records (FOOBAR)pl:Foobar
nl:Foobar ja:Foobar sv:Foobar ru:Foobar

