A Public Service Announcement To All Programmers
April 23rd, 2006You know what really gets on my nerves? When programmers use “foo” and “bar” as variable names in example code. I mean, yes, I know that “fubar” is a clever little acronym with a swear word in it, but if EVERY PROGRAMMER uses it for EVERY SINGLE PROGRAMMING EXAMPLE (which practically everyone does, I swear!), it’s no longer clever, but downright stupid and uncreative. And being uncreative perpetuates stereotypes of programmers being nothing more than automaton droids who tap away at their keyboards all day without a single ounce of emotion. And that just isn’t fair.
On a side note, someone wrote an Italian walkthrough for Cubert Badbone. If you actually care and stuff, it can be found on the downloads page.

April 24th, 2006 at 12:35 am
I’m glad to say I’ve never used foo or bar. (I have been guilty of overusing one-letter names, though, which isn’t much better.)
April 24th, 2006 at 1:11 am
haha, i totally agree with you! actually that’s the first thing i tell my students in the programming classes: not to use nonsense variable names. and as i’m the one correcting their stuff… *hehe*
wikipedia told me that fubar is originally an abbreviation of the german word “furchtbar” what means horrible - which says all about using foo and bar as variable names.
April 24th, 2006 at 1:33 pm
Yay!
I don’t have as much of a problem with nonsense variable names, as long as they’re actually creative and clever. However, I definitely think it makes life easier for everyone if variable names actually make some sense within the context of the programming example. Even if it’s just an example, using a practical application to demonstrate said example helps me learn far better than having to make my way around some code that doesn’t really do anything useful.
April 25th, 2006 at 10:18 pm
From Wikipedia, here’s a list of alternative variable names: sapfu, snafu, susfu, fumtu, fubb, tarfu, tofu, gfu, samfu, tuifu, fugazi, janfu, jaafu, dilligaf, tins and ihtfp
But seriously: I personally use more descriptive names, but if you work with a database on the other end and you have one hundred and thirty three variables variables with names like people_b4c5, attritor_price2 and managers_fc_less_benefits, thinks can get really FUBAR.
April 29th, 2006 at 11:45 am
I myself am partial to “Moo” and “Face.”
I name my variables after ridiculous nicknames for asinine managers at TELUS.
I guess that would count as a nonsense variable name… I should start naming them after my family, that would be funny. “Man” “Ooch” “New” “Wife”
April 29th, 2006 at 11:53 am
HAHA! Oddly enough, I used “moo” on a recent exam.
April 30th, 2006 at 12:57 pm
I use moo a lot in real life.
May 2nd, 2006 at 12:53 am
After reading this I went and search the SLUDGE help file to make sure it’s not that which triggered your li’l rant. Whew, looks like I’m in the clear. Unless it’s one of the things on the forums. Hang on.
Hey, nothing there, too! Who’d have thought it?
Single-letter variables are the invention of some other-worldly demonic code beast. At work, one of our programmers thought it was a good idea to introduce a global variable called ‘g’. It was an array. Nobody was quite sure what it did, but I think the program broke without it. He’s left now, although ‘g’ probably still lives on while we try to fathom what it’s for.
May 2nd, 2006 at 11:06 am
I said I’ve been guilty of overusing single-letter variables, but I’d never give a global variable a single letter name. That’s just… well, there are sites dedicated for that sort of thing.
May 2nd, 2006 at 12:33 pm
Tim: Nah, of course not. My rant was triggered by all my computer science profs over the past couple of years who insist on using foo and bar. Besides, I haven’t looked at a single line of SLUDGE code in two months!
May 3rd, 2006 at 12:41 am
I pity the foo.
/shows age