What does “Foobar ” or “foo” or “bar” mean? [closed]

旧城冷巷雨未停 提交于 2020-01-04 07:45:41

问题


These words seem to be widely used to naming variables. What do these words stand for and why are they so frequently used? By the way, what's the origins of them?


回答1:


These two words are just placeholders in computer programs. Wikipedia https://en.wikipedia.org/wiki/Foobar seems have a good answer. There are several origin of foo:

  1. A nonsense word in the 1930s comic Smokey Stover by Bill Holman due to having seen it on bottom of a jade Chinese figurine in Chinatown, San Francisco, meaning "good luck".
  2. US Army WWII acronym FUBAR, "F-ed Up Beyond All Recognition", which also explains the origin of bar.
  3. The use of foo in a programming context is generally credited to the Tech Model Railroad Club (TMRC) of MIT from circa 1960.



回答2:


It comes from the term FUBAR, which again stands for Fucked Up Beyond All Repair/Recognition. More on it from Wikipedia, here https://en.wiktionary.org/wiki/FUBAR




回答3:


They have been used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept. The words themselves have no meaning in this usage. Foobar is sometimes used alone; foo, bar, and baz are sometimes used, when multiple entities are needed.



来源:https://stackoverflow.com/questions/34037458/what-does-foobar-or-foo-or-bar-mean

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!