Follow

I just submitted a bug report this morning and my example code used canonical metasyntactic variable names like "foo", "bar", and "baz".

I was curious where these names came from and found a Wikipedia article on it (because Of Course there's an article on this. I <3 Wikipedia).

The article suggests foo is maybe similar to 福 ("fu"), which can mean happiness.

So "foo" in your code can be an expression of happiness. 😋

· · Web · 1 · 0 · 0

@cuchaz I don't know about baz, but I've always assumed foo and bar were a derivation from the military acronym "fubar" ("f'd up beyond all reason") but not sure how it got into code. I like your interpretation better, haha.

@emartin The FUBAR connection is often repeated, but it looks like "foo" entered the language much earlier. So maybe the FUBAR connection is just a coincidence?

There are other possibilities for "bar"'s origin story too. Apparently IBM had something called a "base address register" (BAR) which was sometimes named "foo".

Some seem to think "baz" is a memeification of "bar" from another university at the time.

I found this resource really helpful when researching:

softwareengineering.stackexcha

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!