What does foo mean?

I have seen many people using "foo" as method names or class names in java on Stackoverflow and other things. What kind of fyu? Is it just a common name for any method, class, etc., Or does it really mean anything? And why foo? Is it just for java or do people use it for other languages?

+6
source share
4 answers

It is traditionally used only for a random name. Some other common ones:

  • Foo
  • Bar
  • Quux
  • Baz

The alleged origin of foo and bar is that "FUBAR" was a World War II slang for F *** ed Up Beyond All Recognition. FUBAR => FOOBAR => Foo and Bar.

In fact, there is no good reason to choose it, except that no language leaves the word foo and that it is easy to enter / read.

+16
source

This is a common name for a thing, using in computer science in general. Etymologically, "foo" is the first syllable of "FUBAR", which is an acronym for "** Up Up Beyond All Recognition / Recovery".

+4
source

foo is a term used to represent something if you are not too attached to a value. I could say object a in its place or literally something else.

see examples 1 or 4 here: http://www.urbandictionary.com/define.php?term=foo

+2
source

it's just an identifier that you can assign methods or classes .

0
source

Source: https://habr.com/ru/post/958826/