foo 是什么意思
Contents
Foo 是什么意思
http://www.cnblogs.com/felicity/archive/2010/11/30/1892100.html
不管是java,C++,还是PHP,每次都能看到 foo = bar 的例子,这两个单词很恶心,foo查不到字典,bar的解释又让人跟编程联系不上,更弄不清楚这个神秘的foo是个什么关系。
语意不清,学起来心里老是有疙疙瘩瘩的感觉,于是查吧,终于揭开了这两个东西的不正常关系,讲个各个处在闹心中的初学者们听吧。
参考了众多的网络资料,最后,明确的告诉大家,foo和bar就是外国人的张三、李四、王二麻子,只是一种随便的命名方式。跟c语言里面的i,j,k同出一辙。
就是说foo = bar 跟 变量张三 = 李四的侄子 一个意图,所以童鞋们就不要再找foo到底是个啥了。
问foo是啥就跟问张三是谁一样,我想外国人一定也很想知道,张三到底是谁,这个人怎么这么有名,总能看到这个名字,但是历史上记载却又找不到他。
为了这个可恶的foo,居然还动用RFC给foo下了一个明确的词源追踪,无聊的童鞋可以看RFC3092解解闷。
https://www.ietf.org/rfc/rfc3092.txt
下面是网上搜刮来的各种解释:
Foo: 本意指程序员用来代表数据、功能或命令的变量。O’Reilly媒体认为FOO是Friends of O’Reilly的缩写,并把他们在2003年举办的年会命名为"2003 FOO”。现在则更多地指声势浩大的某行业大会。
foo = fuck oriented object
foo是"你要让它是什么就是什么”。FOO可以具有用户赋于的任何意义。
foo—–潦草的意思!表示很随便的定义!
foo没有意义
foo的意思是:Factory Of Objects
foo: 一塌糊涂或者bar: 一团糟
foo
不同的字典对其解释相去甚远,一说来自中国"福"字的发音,又有解释为二战时期的一种武器。然而若把众多的解释放在编程领域,关于 foobar的说法是我认为最为贴切的解释。foobar又为foo-bar,其中bar是beyond all recognition的缩写,通俗点就是无法识别,一塌糊涂的意思。而foo是fu的变体,fu是英语习语fuck-up的缩写,同样是一团糟的意思。于是,若你有些编程经验,我想你应该已经明白了为何如今许多编程实例所涉及的事物均被冠名为foo.
- 介绍
至今约有212 个RFC, 或者约7%的RFC, 从[RFC269]开始,包括了术语’foo’,‘bar’ 或’foobar’作为伪变量而没有任何适当的解释或定义。这可能被认为是微不足道的,但一些新来者,特别是那些非英语国家的人,在理解这些术语时会遇到困难。本文纠正这一问题。
- 定义和语源
bar /bar/ n. [JARGON]
- 第二个伪变量,在foo 之后而在baz 之前。
“Suppose we have two functions: FOO and BAR. FOO calls BAR….”
- 经常加在foo 后面构成foobar。
foo /foo/
interj. 令人反感的术语。
用于任何东西的一般的名称,特别是程序和文件 (特别是草稿文件) 。
用于语法例释的标准伪变量表中的第一个(bar, baz, qux, quux, corge,grault, garply, waldo, fred, plugh, xyzzy, thud). [JARGON]
当连接’bar’ 时通常可以追溯到二战时军中的俚语FUBAR (Fucked Up Beyond All Repair),最后演变成了foobar。早期版本的Jargon File [JARGON]称这一变化是战后的修正,但现在看来更像是FUBAR 本身是’foo’的衍生词。可能是受到了德语’furchtbar’ (可怕的) 的影响 - 也许最初形式是’foobar’。
似乎’foo’ 这个词在战前的漫画和卡通中可以找到历史。在1938年华纳兄弟卡通公司Robert Clampett 指导的"The Daffy Doc”,Daffy Duck 的早期版本,有一句口号"SILENCE IS FOO!"。‘FOO’和’BAR’ 也在Walt Kelly的连环漫画"Pogo"中出现。最早有文献记载的使用是在Bill Holman 的一个消防队员的超现实主义连环漫画"Smokey Stover” 中。在1930到1952年间该连环漫画出现在许多美国漫画中,包括"Everybody’s”。它经常在汽车的车牌中包含单词"FOO”, 在背景画面中无意义的话中,如"He who foos last foos best"或"Many smoke but foo men chew”,Smokey 说"Where there’s foo, there’s fire”。Bill Holman,该漫画的作者,在其中充满了奇妙的笑话和个人发明,包括其它无意义的短语如"Notary Sojac"和"1506 nix nix”。依照华纳兄弟卡通公司[WBCC]的说法,Holman 是在一个中国小雕像的底部发现"foo” 这个词的。这是个似是而非的说法;中国的小雕像经常有避邪用的题字,这可能是中文’fu’ (有时候音译为’foo’) ,当发音正确时意为"幸福” (立在许多中餐馆侧面的狮子-狗型 守护神正确的称呼是"fu dogs”) [PERS]。说英语的人认为Holman的’foo’ 这个无意义的词毫无疑问的受到Yiddish 语的’feh’ 和英语的’fooey’ 以及’fool’的影响。[JARGON, FOLDOC]
Holman的漫画描写了一台两轮消防车名叫Foomobile。 该系列漫画在1930 年代后流行极了,传说Indiana 的一个制造商甚至造出了一台可操作的 Foomobile。 按照美国漫画百科全书[EAC] 的说法,‘Foo’ 热横扫美国,在流行歌曲和超过500个’Foo 俱乐部’ 中可以找到证据。作为流行的遗迹 ‘foo’ 嵌入了流行文化 (包括华纳兄弟卡通公司1938-39的the couple of appearances) 但它的起源被迅速遗忘了。[JARGON]
二战后该术语在美国军队仍存留下来。在1944-45 年,术语’foo fighters’[FF] 被雷达操作员用来描述一种神秘的或伪造的轨迹。那后来被称为UFO ( 在1995年通过一个叫Better grunge-rock bands[BFF] 的词老的术语又重新露面) 。据信它和漫画Smokey Stover 有关[PERS]。
战争中美国和英国军队经常交换俚语。Period sources报告说二战中’FOO’ 变成了半传奇式的主题,英国军队的涂鸦或多或少等于美国的Kilroy [WORDS]。 英国军队走到哪里,都会涂上"FOO was here"或者类似的话。几本俚语字典断言FOO 来自前线巡查官,但这 (像同时代的"FUBAR”) 也许 是backronym[JARGON]。 40年后,Paul Dickson的优秀著作"Words”[WORDS]追踪"Foo"到了一个不明的英国海军杂志,引用如下:
“Mr. Foo is a mysterious Second World War product, gifted with bitter omniscience and sarcasm.”
更早版本的Jargon File 暗示其用法的可能来自"FOO, Lampoons and Parody”,1958 年发行的一本漫画的标题,Charles 和Robert Crumb合作的一个项目。
尽管Robert Crumb (在他后来十几年) 后来成了最重要最有影响力的地下 漫画作家,这次成功相当艰难;实际上,因为厌恶,兄弟俩后来烧掉了大部分的拷贝。标题FOO 用大号字印在封面上。然而,非常少的拷贝确实流
传了下来,Crumb ‘全集’的学生确定它参考的是较早的Smokey Stover 漫 画。Crumb的作品可能也受到1951-52年出版的的短命加拿大滑稽杂志"Foo"的影响[JARGON]。
一个old-time成员报告说在1959年TMRC (MIT 的技术模型铁路俱乐部) 编译的"TMRC语言字典” 中有Foo 的词条。当前在线版本中的"Foo” 是唯一标记为红色的词,有如下内容[TMRC]:
Foo: The sacred syllable (FOO MANI PADME HUM); to be spoken only when under obligation to commune with the Deity. Our first obligation is to keep the Foo Counters turning.
这个定义用了Bill Holman 的无意义的词,流行之后20年且确实存在流行文化和俚语中,使一个"ha ha only serious"象西藏佛教一样深奥。今天的人会发现很难抵挡这样精心制作的笑话,而不象1959年代的人那样不易受感染。[JARGON]
[EF]王子Foo 是Pheebor 最后的统治者,和Phee Helm 的所有者,在rgign of Entharion之前约400 年。当Foo 被来自Borphee 的叫作"eastern fop” 的什么人砍头时,Pheebor 的显赫时代结束了,而Borphee越升到它现在的位置。
[OED] 一个13-16 世纪用法,指恶魔或任何敌人。最早的引用是在1366 年,Chaucer A B C (84): “Lat not our alder foo [devil] make hisbobance [boast]"。Chaucer的"Foo"可能是现代英语的"foe”
稀有种类的狗
波美拉尼亚丝毛狗被认为灭
《关于foo的来源》
foo /foo/
/interj./ Term of disgust.
Used very generally as a sample name for absolutely anything, esp. programs and files (esp. scratch files).
First on the standard list of metasyntactic variables used in syntax examples. See also
bar, baz, qux, quux, corge, grault, garply, waldo, fred, plugh, xyzzy, thud.
The etymology of hackish `foo ' is obscure. When used in connection with `bar ' it is generally traced to the WWII-era Army slang acronym FUBAR (`F-u-c-k-e-d Up Beyond All Repair ‘), later bowdlerized to foobar. (See also
FUBAR.)
However, the use of the word `foo ' itself has more complicated antecedents, including a long history in comic strips and cartoons. The old “Smokey Stover " comic strips by Bill Holman often included the word `FOO ‘, in
particular on license plates of cars; allegedly, `FOO ' and `BAR ' also occurred in Walt Kelly ‘s “Pogo " strips. In the
1938 cartoon “The Daffy Doc “, a very early version of Daffy Duck holds up a sign saying “SILENCE IS FOO! "
oddly, this seems to refer to some approving or positive affirmative use of foo. It has been suggested that this
might be related to the Chinese word `fu ' (sometimes transliterated `foo ‘), which can mean “happiness " when
spoken with the proper tone (the lion-dog guardians flanking the steps of many Chinese restaurants are properly
called “fu dogs “).
Paul Dickson ‘s excellent book “Words " (Dell, 1982, ISBN 0-440-52260-7) traces “Foo " to an unspecified British
naval magazine in 1946, quoting as follows: “Mr. Foo is a mysterious Second World War product, gifted with
bitter omniscience and sarcasm. "
Other sources confirm that `FOO ' was a semi-legendary subject of WWII British-army graffiti more-or-less
equivalent to the American Kilroy. Where British troops went, the graffito “FOO was here " or something similar
showed up. Several slang dictionaries aver that FOO probably came from Forward Observation Officer. In this
connection, the later American military slang `foo fighters ' is interesting; at least as far back as the 1950s, radar
operators used it for the kind of mysterious or spurious trace that would later be called a UFO (the older term
resurfaced in popular American usage in 1995 via the name of one of the better grunge-rock bands).
Earlier versions of this entry suggested the possibility that hacker usage actually sprang from “FOO, Lampoons and Parody “, the title of a comic book first issued in September 1958, a joint project of Charles and Robert Crumb. Though Robert Crumb (then in his mid-teens) later became one of the most important and influential
artists in underground comics, this venture was hardly a success; indeed, the brothers later burned most of the
existing copies in disgust. The title FOO was featured in large letters on the front cover. However, very few
copies of this comic actually circulated, and students of Crumb ‘s `oeuvre ' have established that this title was a
reference to the earlier Smokey Stover comics.
An old-time member reports that in the 1959 “Dictionary of the TMRC Language “, compiled at TMRC, there was
an entry that went something like this:
FOO: The first syllable of the sacred chant phrase “FOO MANE PADME HUM. " Our first obligation
is to keep the foo counters turning.
For more about the legendary foo counters, see TMRC. Almost the entire staff of what later became the MIT AI
Lab was involved with TMRC, and probably picked the word up there.
Very probably, hackish `foo ' had no single origin and derives through all these channels from Yiddish `feh '
and/or English `fooey ‘.
Author -
LastMod 2012-04-04