Live data from Hacker News

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

softwareengineering.stackexchange.com

61–70 of 150 posts

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

#61

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/

> old-school-nerd-bro

I'm trying to maintain that the nerds of yore and the bros* who invaded in the 2010s are different groups -- in which case "old-school nerd bro" would be a contradiction in terms -- but alas "bro" has simply come to mean "male", and, to the English majors writing the newspaper articles, "they all look the same". So maybe I need to give up.

* etymology: "tech bro", in analogy with "finance bro", which originated because fraternity brothers from top schools used to go into finance, but then migrated into Tech around '08. Associated stereotypically with developed pectorals and polo shirts with popped collars. Close to the "Chad" archetype, but with some light granola/yoga overtones.

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

#62
post #56
post #29

Earlier quoted context omitted.

I imagine that, due to the societal expectations historically placed on women, they’ve typically had to be “the adult in the room.” Contrast this with men historically being able to get away with acting childishly (or worse). So when terminology used in the workplace is particularly vulgar, it would follow that women would take more issue with it than men.

This is a sexist statement

How so?

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

#63

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.

There was a concept of treating women with respect.

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

#64
post #56
post #29

Earlier quoted context omitted.

I imagine that, due to the societal expectations historically placed on women, they’ve typically had to be “the adult in the room.” Contrast this with men historically being able to get away with acting childishly (or worse). So when terminology used in the workplace is particularly vulgar, it would follow that women would take more issue with it than men.

This is a sexist statement

Describing the factual sexist environment that existed in a prior time (or, hell, the ones that exist today) is not itself sexist.

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

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

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

#67

No zot? I don't remember where I picked them up. But it was always fubar and zot.

Never heard of zot, but baz

Zot is (at least in part) from the old comic Wizard of Id and (by the same artist, Johnny Hart and Brant Parker) BC. It was the sound of a lightning bolt (natural or wizard-created).

Reprint cover of "Ala Ka Zot!":

https://m.media-amazon.com/images/I/61hytBWmsqL._SL1000_.jpg

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

#68

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…

On a related note, we all know the story from WW2 where Bastogne was surrounded by the Wehrmacht, and the Wehrmacht sent a note to General McAuliffe suggesting he surrender. He returned with a note that simply said "nuts".

I simply did not believe than an American GI ever said "nuts". So, I asked my dad (WW2 veteran). He said he briefly worked for the General, and asked him what he actually wrote. The General laughed, and replied "what do you think I wrote?"

F-U

The Stars&Stripes journalists changed it to "nuts" thinking the Americans couldn't handle the profanity.

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

#69
post #56
post #29

Earlier quoted context omitted.

I imagine that, due to the societal expectations historically placed on women, they’ve typically had to be “the adult in the room.” Contrast this with men historically being able to get away with acting childishly (or worse). So when terminology used in the workplace is particularly vulgar, it would follow that women would take more issue with it than men.

This is a sexist statement

It’s a discussion about a sexist environment. Catch up

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

#70

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/

> old-school-nerd-bro I'm trying to maintain that the nerds of yore and the bros* who invaded in the 2010s are different groups -- in which case "old-school nerd bro" would be a contradiction in terms -- but alas "bro" has simply come to mean "male", and, to the English majors writing the newspaper articles, "they all look the same". So maybe I need to give up. * etymology: "tech bro", in analogy with "finance bro",…

I've been the same way but I think it's time to give up; the language has moved on, and it's only a very specific age bracket that recognizes the distinction. Graybeard means something different now too. It's okay though. It's not important and doesn't need to be maintained; it was just another form of gate-keeping...

the early "nerd-bro" practically required the distinction as a form of identity reclamation in a culture that disparaged their puny interests in computing. We should celebrate that that particular shield is no longer needed, and thus that gatekeeping is no longer needed for ego-survival, either.

Post reply on HN