• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is 'FOO' ??  RSS feed

 
Colin Kenworthy
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've noticed in several books, and on the Sun website the use of the word 'foo' either in a String variable or as a method name.
Can anyone shed some light as to its origin or its actual meaning ?
puzzled,
Colin.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Colin
The origin of the word 'foo' comes from the word fubar. This word, as far as I know, comes from the military and is an acronym for 'fouled up beyond all recognition'. mostly the word fouled is substituted for another word
That's way you'll quite often see foo and bar used in the same examples.

------------------
Dave
Sun Certified Programmer for the Java� 2 Platform
 
Colin Kenworthy
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers Dave :-) I get the picture!
Subject closed.
Colin.
 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LOL...I knew the origin of the foo and bar terms, but I always wondered why they were used in Java examples, I don't see the correlation. It's funny though.
------------------
Michael J Bruesch
Codito, ergo sum...
I code, therefore I am.
http://www.geocities.com/mjbruesch
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tradition dates WAYY back beyond Java to the early days of programming. You must remember that when computers were large and VERY expensive that most of the programmers had previous military experience. This is a function of the time of its development (late 1940's and 1950's and early 60's). Also, many of the original large software systems (like SAGE) were for national defense in both the U.S. and Britain, where the terms originated.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually when I do not understand some part of geek lexicon, I use Jargon
For example:
foo /foo/
2. [very common] Used very generally as a sample name for absolutely anything, esp. programs and files (esp. scratch files).

 
Michael Bruesch
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this stuff gonna be on the SCJP2 Test? .....I need to write this down...
(j/k)

------------------
Michael J Bruesch
Codito, ergo sum...
I code, therefore I am.
http://www.geocities.com/mjbruesch
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
foo should be banned in programming!!!
I took a C++ course and every example the instructor used was foo! Try and learn the friend concept with that. Classes foo and frindOfFoo
I also took over a project from a third party and you guessed it. An entire class with foo, foo1 and foo2 as the local variables
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carl .... ur world was full(fooooooolll ) of foo...
Thnx Dave 4 a nice explanation!

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dunno Carl,

I think using foo1, foo2 would be a good thing to assist in decompiled code obfuscation.

Just kidding of course.
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael,
sure it will be. It was in my SCPJ2 exam!!!
ANd I was shocked down exactly by that question because I remembered it for all my life because there was no connection between the question and the answers...
You better be ready
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kyle,
are we still dominated by 40-50 yrs militaries?
Now I come to understanding of some unclear areas in Java
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this theme should be transfered to Java Certification Study or Java in General (beginner). It is about very important concept/pattern and naming policy. I could have avoided a lot of grey hairs, had I known all these (mnemonics, rationale) before!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!