This post originated from an RSS feed registered with Java Buzz
by Ben Hosking.
Original Post: Why are the variables foo and bar used so often
Feed Title: A Funny Java Flavoured Look at the World
Feed URL: http://businesslogs.com/WebLog/RSS.xml
Feed Description: The blog looks at using Java and programming in general as it pops up in life as a Java programmer. It will have links to interesting Java articles and resources. It will also have a lot of SCJP Java 1.5 information and links as I am currently studying
This was brought up whilst listening to the Java Posse they were talking about using foo bar and someone spoke too one of the posse members saying it was funny he had used foo bar in his presentations. They commented that people (like me) probably use the variables foo and bar just because they have seen examples using foo and bar without realising the real reason why they are used. They all laughed about it but then didn't explain what it referred to. Wikipedia came up with this definition http://en.wikipedia.org/wiki/Foobar
Most likely, "foo" and "bar" were derived from "foobar," which in turn had its origins in the military slang acronym FUBAR. The most common rendition is "Fucked Up Beyond All Repair" (Several variant renditions exist, with, for example, the words "Fouled", "Any Repair", "Any Redemption", "All Reality", "All Recognition", or "All Reason" used instead of the versions above.)
So this would explain why the Java Posse were giggling like school kids when discussing FUBAR. My other favourite programming acronym is RTFM which means "READ THE FUCKING MANUAL". I used to work on a helpdesk and use log calls under this category. Another similar item is why we make hello world programs, check out my previous blog if you want to find out what was the first hello world program
It brings me onto the subject of the comment habits that each developer has. We were told in my last place of work to stop putting swear words as comments, a not unreasonable suggestion. The reason for this was because one of the directors was doing a demo of the software using a database and he was selecting some products from the database and the first two products were
YOU SHOULD LICK
BIG DOGS HAIRY BALLS
It of course became a legendary story that went around the office and I will add it wasn't me who made that database. My embarrassing story(s) that I once came into work with sick on my leg from being drunk and then late for work and rushed in only to notice the sick on my trouser leg just as I walked through the door. I also once went back to the office with my buddies after we had been boozing and we prix sticked everyone's mouse's to their monitors, very childish I admit but I was young.
My comment and variables habits usually involve using the word fish and different types of fish. I am not really sure how I got in this habit. I'm thinking of changing it to perhaps using different animals