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…
What is the history of the use of "foo" and "bar" in source code examples? (2012)
131–140 of 150 posts
Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)
#132Earlier 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
Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)
#133Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)
#134MIT 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…
Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)
#135Earlier quoted context omitted.
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)
#136Earlier quoted context omitted.
Why would women in particular object to "fu" and not "foo"?
I think it is actually a little funny, nowadays of course the assumption that we particularly should be less profane around women would be seen as old fashioned and kind of a bit sexist. But I guess at the time swearing less was probably seen as a way to make women less uncomfortable. And I’m sure in some cases it did help. An interesting example of the quirks we carry along with us, and the fact that the combination…
Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)
#137Earlier quoted context omitted.
At some point the lines crossed between people whose first exposure was the old "FUBAR" and those whose first exposure was the tech "foo/bar/baz". I wonder when it was.
I imagine that many of us who got into programming through the 1980s home computer boom encountered the terms "foo" and "bar" before we were old enough that adults would have felt comfortable using "FUBAR" around us.
Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)
#138MIT 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…
Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)
#139Does 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.
foo/bar/baz/bing/bang/bong
Once in a while I’ll throw “biz” in after baz. I suspect the bar/baz pairing felt like alliteration to me and I extended it.
I’ve never used it in production code of course, but I have in tests. For string interpolation or parsing tests you tend to need a lot of variables or values and you don’t care what the variable means you just want the right ones placed in or extracted from the correct spots.
In particular if the rest of the data looks legit and the bits sunstituted looks like gibberish, I find it makes the red tests’ failure message quicker to read.
Re: What is the history of the use of "foo" and "bar" in source code examples? (2012)
#140Earlier quoted context omitted.
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 ten…
Yea but the truth is a huge of audience of people who are not super familiar with the syntax of a languague will read tutorials describing how to build stuff in that language hoping they can piece things together. So for them it would be helpful.
Also, isn't all of programming just playing with types in a way? I feel like Intro to types never stops lol.