Live data from Hacker News

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

softwareengineering.stackexchange.com

81–90 of 150 posts

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

#81

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"?

Because fu.

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

#83
post #57

Earlier quoted context omitted.

In the 1940s, the Army used a phonetic alphabet starting Able, Baker, Charlie. My late father was on the first two postwar atomic bomb tests (the first after Trinity, and at Hiroshima, Nagasaki) which were Able and Baker. Able was an air burst over Bikini (thus the name of the swimsuit). Baker, the water burst, was the world's first atomic disaster; as a result of Baker, the third scheduled test Charlie was cancelled…

The change from able... to alpha... was a NATO thing. some European countries don't use the "a" in "able", so it was changed to the "a" in "alpha"

Also there is a way to pronounce all of the NATO alphabet words that is not exactly a normal english pronounciation in order to make the first letter obvious and to reduce the possibility of mistranscription (the most obvious example is “nineR”). Sadly this does not really work in Czech, as laypeople will very often interpret “keˈbɛk” as K. (So the takeaway there is to not use NATO phonetic alphabet when you are dictating the pickup code to the package pickup point clerk)

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

#84

Earlier quoted context omitted.

How about x, y, f?

How about emoji? https://www.globalnerdy.com/wp-content/uploads/2014/06/poopy...

I have seen some tutorials where emojis are used as metasyntactic variables. Not an improvement

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

#85
post #20

Earlier quoted context omitted.

Is it not clear what “f” and “u” is short for?

Of course it is. What's not clear is what that has to do with women.

People had different values than you do in the past. They also have different values right now.

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

#86

Earlier quoted context omitted.

In the 60's the belief was that they could not tolerate profanity. Or maybe it was that they'd tattle on the rest of us.

There was a concept of treating women with respect.

That's a non-sequitur. There are plenty of other words that start with 'fu-'. It's also a loanword from Chinese.

And even if not, I haven't heard anyone describe the coinage 'fupa' as offensive.

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

#87

Earlier quoted context omitted.

I limit swearing in mixed company and I'm not even that old.

I limit swearing among people I don’t know very well of either gender. Among my friends, I haven’t noticed any difference in who is bothered by it.

I only limit swearing in professional environments; meetings to be honest.

Everywhere else gets the shit and hell and damn that I use in regular language. No slurs and no sexual words like Fuck. But that's just good manners.

Curse words are like salt and pepper for the language. They're not necessary, but often add just the right amount of extra spice.

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

#88

Earlier quoted context omitted.

NATO phonetic alphabet is used in all areas where you have to say letters over voice. One character variable names for temp or iterator values are everywhere in programming. But I've never ever encountered one spelled out as a full transcriptions of the NATO phonetic alphabet like alfa, bravo, charlie. Exception is alpha for probability/statistics.

> NATO phonetic alphabet is used in all areas where you have to say letters over voice. Not all. Military definitely favors NATO, but there are other phonetic alphabets in use. In particular, at least in the US, fire/ems personnel (and sometimes also law enforcement) use alternatives. The one that goes Adam, Boy (or Baker), Charlie, David, Edward, Frank, ... is still widely used. I've also known agencies to use a mix…

Law enforcement/EMS often have their own phonetic alphabets and it is not that uncommon to use two at once: one for call signs and second for the actual alphanumeric data (in theory, in practice it gets mixed up, but everybody still understands the meaning)

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

#89

Earlier quoted context omitted.

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

In the 60's the belief was that they could not tolerate profanity. Or maybe it was that they'd tattle on the rest of us.

In the 60s, women were generally infantilized, but I suspect the “it was done for the women” explanation for the drift of “fu” to the already-existing term “foo” once separate from the other part of “fubar” is a just-so story, rather than a historical fact.

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

#90
post #87

Earlier quoted context omitted.

I limit swearing among people I don’t know very well of either gender. Among my friends, I haven’t noticed any difference in who is bothered by it.

I only limit swearing in professional environments; meetings to be honest. Everywhere else gets the shit and hell and damn that I use in regular language. No slurs and no sexual words like Fuck. But that's just good manners. Curse words are like salt and pepper for the language. They're not necessary, but often add just the right amount of extra spice.

Oh, that’s an interesting thought, good point. I agree on the idea that slurs and sex-based stuff should be avoided (crassness should be fun for everyone, not exclusionary). I hadn’t put fuck in that bucket really, but of course it does have some sexual definitions.
Post reply on HN