Live data from Hacker News

What is the history of the use of "foo" and "bar" in source code examples? (2012)

softwareengineering.stackexchange.com

11–20 of 150 posts

Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)

#11

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 giv…

> they are hard to pronounce

I’d find it hard to think of two words easier to pronounce— what do you mean by this?

Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)

#12

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 giv…

> they are hard to pronounce I’d find it hard to think of two words easier to pronounce— what do you mean by this?

Proof that for any little thing that existed, exists, or could ever exist in this universe, there will be a non-zero list of human beings unhappy with it. Until the end of humanity, at least...

Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)

#13
post #5

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). F…

The missing link is 'FURCHTBAR'. Smokey Stover started the meme of substituting 'foo' into words. 1930s german language classes turned furchtbar (frightful) into 'foo-bar'. The US military acronymized it into FUBAR. Apparently MIT adopted fu() and bar() as algebra placeholders. I'm partial to the 1938 song WHAT THIS COUNTRY NEEDS IS FOO - https://m.youtube.com/watch?v=W2pljKyCgwc

Seems like that retelling comes from an IETF RFC: https://www.ietf.org/rfc/rfc3092.txt (Etymology of "Foo")

Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)

#14
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.

Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)

#15

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 giv…

> 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.

I couldn’t disagree more. The entire point is that the variables are disconnected from the matter at hand. They’re widely recognised as placeholders, single syllable, distinctly pronounced from each other, and have an implied ordering.

Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)

#16

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 giv…

The very reason you say something like foo is to avoid using any specific example that might actually mean something and confuse the listener into thinking it matters and focussing on some irrelevant detail instead of the actual concept being illustrated.

You detest that someone says "thing" instead of "house" or something?

"...so you take a thing-"

"what thing?"

"It doesn't matter. It might be anything. So you-"

"A car?"

Come on man.

Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)

#17

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 kne…

Why would women in particular object to "fu" and not "foo"?

Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)

#20

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 kne…

Why would women in particular object to "fu" and not "foo"?

Is it not clear what “f” and “u” is short for?
Post reply on HN