+ 13
What is foo?
14 Answers
+ 25
Great question. In computer science, "foo" is just a placeholder name or a "Metasyntactic variable". A metasyntactic variable basically just means a "word without meaning". You can read more about it here:
https://en.wikipedia.org/wiki/Foobar
+ 11
Back in World War 2, foo was used to reference something they didnt know what it was. Now foo is just used as a miscellaneous 'variable' name.
+ 7
This is similar to 'Lorem Ipsum' in web design
+ 5
Similar to spam and eggs in Python language.
+ 2
Just like "John Smith" in sample forms! It's one of generic names for variables, methods, objects, ... in learning resources and documents. Another well known one is "bar".
+ 2
Just like "i", as you might see in some examples, it is just a placeholder commonly used in thing such as loops. Most programmers use "i" or "foo" to create loops much faster than writing meaninful names like "loopCtrl" (for example) because when you need to write multiple loops, having many different loops with multiple names yet for the same exact thing in different scopes can get confusing.
+ 2
foo is just a variable name
+ 2
foo is the name we use for fake method, var
đ
+ 2
'foo' stands for 'File Or Object'. Such an acronym is frequently used as a variable name for identifying any generic entity present in the code of which it turns out to be not so important to specify a precise and evocative name, because, for instance, the entity in question is just an accessory or intermediate variable, or rather a temporary file.
+ 1
used when you don't know or don't want to think what name to use
+ 1
an arbitrary variable name
+ 1
@Andrea in WWII, FUBAR meant "F****d Up Beyond All Recognition / All Reason / Any Repair"
+ 1
@Thomas, yes I was aware of that was well...lol. I just didnt want to write it out. But, yes..he is right, and that is what I always think as well when I see "fubar".
0
"foo" is used for the purpose of "better" understanding they have used ..in technical terms it is called as function or variable name. U can use any name.. for eg doo() , too()