Log in

View Full Version : foo bar!



djr33
03-22-2007, 05:18 AM
These strings are frequently used as either the values of or names of a variable, especially in PHP (and, I think, other languages).

Can anyone explain why, or explain their origin?

Twey
03-22-2007, 08:16 AM
See the Jargon File entry on foo (http://www.catb.org/~esr/jargon/html/F/foo.html).

pcbrainbuster
03-22-2007, 08:18 AM
djr23 what you talking about ?

djr33
03-22-2007, 08:29 AM
Interesting, Twey. I guessed as much, though I'm still not sure really why. I guess it's just random enough that it should never conflict with anything?


I'm talking about the tendency to use "foo" and "bar" in example scripts and such.
See:
http://www.dynamicdrive.com/forums/showpost.php?p=82551&postcount=62 (DimX's signature)
http://www.php.net/manual/en/function.echo.php (Look at the example code, after the first few lines)

jscheuer1
03-22-2007, 01:57 PM
foo bar is from a WWII (or other war) acronym (actually FUBAR):

F[deleted]'ed Up Beyond All Recognition

Twey
03-22-2007, 06:01 PM
As stated in the Jargon File, not true: references to "foo" exist from before the earliest known reference to FUBAR.

jscheuer1
03-23-2007, 02:17 AM
Whatever, I thought the question was on foo bar as so often used together as stock variable names in coding. I'm sure that comes from the war reference since they are so often paired. Ever hear the one about the foo bird?