Live data from Hacker News

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

softwareengineering.stackexchange.com

121–130 of 150 posts

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

#121
post #29

Earlier quoted context omitted.

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

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.

> societal expectations historically placed on women, they’ve typically had to be “the adult in the room.”

I think it was the opposite; they were infantilzed and sensitive, considered liable to faint or have a bout of hysteria. They were to be protected. Swearing might upset a woman.

Men had final authority over them in many cases. For example, often women couldn't get jobs without their husband's permission.

Women were sometimes the source of a sensitive, compassionate, nurting viewpoint, a balance to the man's roughness. She might appeal to him, but it was his decision.

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

#122

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/

There was this thing called the Jargon File. Then it was taken over by a rogue person who removed some things which didn't fit his personal liking and put in some other things. There was a lot of drama, but the end result was a skewed file that emphasized certain parts of hacker culture over others.

It might be good to know that you linked to the version which one person had outsized influence of, and should probably not be used to write history from. Except history on early Internet drama, perhaps.

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

#123
post #119

Earlier quoted context omitted.

Prefixing things with My is so Windows 95... In place of foo and bar I prefer to go with stuff like one() two() three(), or a() b() c(), timeless classics that need no explanation.

The point is that tyoe is an EXTREMELY vaulable information and if you are explaining code to someone it is very helpful to clearly see what are keywords, what are arbitrary variable names, and what are the types of the variables. For example if you show me a programming language where there is a list object and you write list.one(), I don't know if list is a variable or a keyword, and I don't know if one is a variab…

Your argument does make sense for teaching an intro to programming type class, where it may not be obvious what is a function name versus variable name. That just hasn't been my audience for a very long time now when explaining anything. I'd likely also go with var1 var2, fn1 fn2 type names if needing non-descriptive placeholders in that case. I mainly avoid foo and bar because to me it's a tired meme, and people tend to understand "variable names and function names can be anything" well before they ask "why does everyone insist on using foo, bar and baz all the time?" which is just extraneous lore. In my case, I was writing QBasic games many years before I encountered my first foo or bar.

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

#125

Does anyone have any other successors to foo and bar? Mine have always been bis buz baz, but I don't know if they're canonical or if I just made up the next words in the sequence.

According to the Jargon File, (http://www.catb.org/~esr/jargon/html/F/foo.html) the successors are baz, qux, quux, etc.

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

#127

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/

There was this thing called the Jargon File. Then it was taken over by a rogue person who removed some things which didn't fit his personal liking and put in some other things. There was a lot of drama, but the end result was a skewed file that emphasized certain parts of hacker culture over others. It might be good to know that you linked to the version which one person had outsized influence of, and should probably…

Can the original be found somewhere?

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

#128

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…

Also legendary is the traditional GIGO which in some programming examples the FU is the garbage in and the BAR is the garbage out.

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

#129

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…

FOOcked-up Beyond All Recognition.
Post reply on HN