Why are the variables foo and bar used so often
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
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
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
4 Comments:
This comment has been removed by a blog administrator.
By
Anonymous, at Fri May 19, 08:17:00 am 2006
You use types of fish for variable names? What a pleasure your code must be to maintain!
By
Anonymous, at Wed Aug 30, 06:33:00 pm 2006
not in the finished code, I only use the fish names whilst I am writing some rough code and trying out new things.
Don't worry they get refactored into something meaningful in the production code
By
The Hosk, at Thu Aug 31, 09:51:00 am 2006
When asked, I always tell people that RTFM stands for 'Read the FAQ & Manual'. But that just makes me sound like I'm from Boston.
By
Anonymous, at Thu Aug 31, 07:00:00 pm 2006
Post a Comment
<< Home