+ 13

What is foo?

2nd Nov 2016, 6:15 AM
Karan Jain
Karan Jain - avatar
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
2nd Nov 2016, 6:19 AM
DaemonErrors
DaemonErrors - avatar
+ 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.
2nd Nov 2016, 2:49 PM
Andrea
Andrea - avatar
+ 7
This is similar to 'Lorem Ipsum' in web design
2nd Nov 2016, 12:41 PM
Amrish
Amrish - avatar
+ 5
Similar to spam and eggs in Python language.
2nd Nov 2016, 10:28 AM
RAMAKRISHNA RAMARAJU
RAMAKRISHNA RAMARAJU - avatar
+ 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".
3rd Nov 2016, 6:40 AM
Mohammad Ali Jariteh
Mohammad Ali Jariteh - avatar
+ 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.
3rd Nov 2016, 9:58 PM
Cody Mathews
Cody Mathews - avatar
+ 2
foo is just a variable name
5th Nov 2016, 4:55 AM
sejal
+ 2
foo is the name we use for fake method, var 😊
6th Nov 2016, 9:43 AM
Harish Nandoliya
Harish Nandoliya - avatar
+ 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.
20th Nov 2016, 4:36 PM
Criso Prasio
Criso Prasio - avatar
+ 1
used when you don't know or don't want to think what name to use
5th Nov 2016, 12:46 AM
Patricia Dinis
Patricia Dinis - avatar
+ 1
an arbitrary variable name
5th Nov 2016, 6:43 AM
Paul Birkholtz
Paul Birkholtz - avatar
+ 1
@Andrea in WWII, FUBAR meant "F****d Up Beyond All Recognition / All Reason / Any Repair"
5th Nov 2016, 9:39 AM
Thomas Shrader
Thomas Shrader - avatar
+ 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".
6th Nov 2016, 6:18 AM
Andrea
Andrea - avatar
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()
6th Nov 2016, 8:31 AM
Mitesh Wadekar
Mitesh Wadekar - avatar