What is "foo" ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 11

What is "foo" ?

In many examples (c++) i have seen a variable name commmonly used . That's " foo", "bar". Does foo symbolises any special meaning .

6th Nov 2019, 1:33 AM
Monkey D. Luffy
Monkey D. Luffy - avatar
17 Answers
+ 25
foo and bar are just variable names created by someone with a sense of humour. They are thought to originate from the military slang FUBAR (F'd Up Beyond All Recognition) :) https://en.wikipedia.org/wiki/Foobar
6th Nov 2019, 3:17 AM
David Ashton
David Ashton - avatar
+ 11
Monical I totally agree. I much prefer the Monty Python variables spam, eggs and ham ๐Ÿ˜„
6th Nov 2019, 9:14 AM
David Ashton
David Ashton - avatar
+ 9
David Ashton I used to think it was 'F*d up beyond any repair' ๐Ÿ˜
6th Nov 2019, 4:01 AM
Ipang
+ 9
Any idea why they didn't call them fu and bar?
7th Nov 2019, 2:41 AM
Sonic
Sonic - avatar
+ 8
foo is OOF BACKWARDS :DDD
6th Nov 2019, 10:45 PM
Jake
+ 8
David Ashton I couldn't find the original one :/ But this is good enough: https://youtu.be/_bW4vEo1F4E Monty python humour is awesome. Haha ๐Ÿ˜ Also: https://youtu.be/sAn7baRbhx4 ๐Ÿ˜‚ ๐Ÿ˜‚ ๐Ÿ˜‚
7th Nov 2019, 2:12 PM
Haris
Haris - avatar
+ 7
Ipang I guess there are a few variations (F'd/Fouled Up Beyond All Recognition/Any Repair/All Reason)
6th Nov 2019, 4:39 AM
David Ashton
David Ashton - avatar
+ 6
a very silly convention used to name functions. It should have ended a long time ago.
6th Nov 2019, 8:19 AM
Logomonic Learning
Logomonic Learning - avatar
+ 5
No it does not have any special meaning and these are just function calls.
6th Nov 2019, 2:20 AM
Avinesh
Avinesh - avatar
7th Nov 2019, 9:08 PM
David Ashton
David Ashton - avatar
+ 4
foo and bar are just demo name for variables and functions. Used to explain some logic or used as a example.
7th Nov 2019, 3:53 AM
Lakhvir Singh
Lakhvir Singh - avatar
+ 4
How about baz?
7th Nov 2019, 7:24 AM
Name Omitted until I come back
+ 3
It's simple for example
7th Nov 2019, 2:28 AM
~*SoverGent*~
~*SoverGent*~ - avatar
+ 2
Vomit๐Ÿ˜‚
7th Nov 2019, 8:05 PM
U E B U N T U
+ 1
- lqatqiy
7th Nov 2019, 9:08 AM
Nzilo Faiba
Nzilo Faiba - avatar
+ 1
Talk of making programming funny๐Ÿ˜‚๐Ÿ˜‚๐Ÿ˜‚
7th Nov 2019, 10:13 AM
Winnie Kamau
Winnie Kamau - avatar
0
good is just the name of variables ppl like to use when teaching that language just like python likes to use spam and eggs in it's lessons.
7th Nov 2019, 6:39 PM
Inkosi
Inkosi - avatar