symbolicAGI
MIT AI Lab back in the 1960s published technical reports containing program code.

The military slang 'FUBAR' f'ed up beyond all recognition, was in the student and professor engineering vocabulary. The tradition became to use 'fu' and 'bar' as nominal function names, in same manner as X and Y were nominal variables.

Often in the MIT technical reports, one would see 'x = fu(y)' or 'y > bar(z)' and so forth. If you knew, you knew.

A few years later, perhaps with the welcome progress of more female faculty and students, textbooks changed the spelling, but not the pronunciation of the vulgar acronym 'fu' to 'foo'. Again, if you knew, you knew.

And now you all know.

fsckboy
I don't know the story of the entry of foo into the computer science lexicon, but it is the case that the early days of computers were populated with a fair number of military veterans because early computers were mostly used in military applications so that produced people with computer experience (not to mention the compulsory draft which meant that a large number of people would have military experience anyway).

FUBAR ("fucked up beyond all recognition") was supposedly a military slang phrase.

And the popular comic strip Smoky Stover starting in the 1930's used the word "Foo" wrt a firefighting character perhaps giving that spelling more currency.

this is the Foomobile from that comic https://duckduckgo.com/?t=ffab&q=Foomobile&iax=images&ia=ima...

douglee650
It blows me away that "The Jargon File" is not required canon. Well, it can be anachronistic and old-school-nerd-bro coded, but there's some primal stuff in there

http://catb.org/jargon/html/

gU9x3u8XmQNG
I have always felt that the foo/bar demo/example snippets have held me back in comprehending code, because there was no reasonable logic to it. It just means nothing to me, other than the FUBAR reference others have mentioned.

I personally, and professionally, think it’s a horrible convention.

lysace
For some reason, in Sweden, the word "gazonk" is common after "foo" and "bar". I've never been been able to figure out why.

Here's a variant:

https://developer.arm.com/documentation/dui0493/i/CHDFAGEE

> foo\bar\baz\gazonk\quux\bop

Some Erlang reference:

https://erlang.org/pipermail/erlang-questions/2009-January/0...

> 43> lists:keysearch(foo, 1, [3.14, {foo,bar} | gazonk]). > {value,{foo,bar}}

The GNU Emacs manual:

https://www.gnu.org/software/emacs/manual/html_node/emacs/Li...

> (setq foo '(bar zot > gazonk))

https://www.epicroadtrips.us/2003/summer/nola/nola_offsite/F...:

> Gazonk is often used as an alternative for baz or as a fourth metasyntactic variable. Some early versions of the popular editor Emacs used gazonk.foo as a default filename.

Yhippa
But where did “baz” come from?
dang
Surprisingly little. Others?

Foo Bar came from model trains at MIT - https://news.ycombinator.com/item?id=41069963 - July 2024 (2 comments)

The Origin of Foo and Bar - https://news.ycombinator.com/item?id=14030938 - April 2017 (1 comment)

Kind of related but not really:

[email protected] - https://news.ycombinator.com/item?id=24605949 - Sept 2020 (281 comments)

The Foo at bar.com - https://news.ycombinator.com/item?id=10108287 - Aug 2015 (29 comments)

[email protected] is a real email address - https://news.ycombinator.com/item?id=3263021 - Nov 2011 (91 comments)

helph67
"In World War One “Foo was here” was scrawled across camps occupied by the Australian Expeditionary Force. Generally assumed to have come from the acronym for Forward Observation Officer, veterans of that war may have brought the tradition with them into the next global conflict over two decades later" https://taskandpurpose.com/history/the-story-of-kilroy-and-w...
jph
In addition to the military-programming history of "foo", there's also a military-programming history for the variable naming convention of "alfa", "bravo", "charlie", "delta", etc.

The naming convention is known as the NATO phonetic alphabet: https://en.wikipedia.org/wiki/NATO_phonetic_alphabet

mikewarot
No zot? I don't remember where I picked them up. But it was always fubar and zot.
baggy_trough
No love for quxx?
golol
foobar should die out. myvariable, mystring, myfunction etc. are better in every way.
Max_Ehrlich
I understand that these variables have a rich and long history, but if you have ever heard a professor or anybody else say "foo" in lecture you will understand why I detest them.

They have absolutely no connection to the matter at hand. Since foo is often used before bar, you would think there is an ordering between the two but there doesn't have to be. They are hard to pronounce and easier to confuse.

Whenever I give an example I use variable names that actually make sense and are related to the example. I'm glad that I have been fortunate to not see "foo" and "bar" anywhere in all of the code I've seen in recent memory.