foo bar 是什么?

Author:David | 【转载时请务必以超链接形式标明文章原始出处和作者信息及本声明
URL:

技术文档中经常出现foo bar命名的变量,一直想知道这两个词到底什么意思。今天看freebsd的文档,又看到这俩,忍不住好奇,搜索了一下。
http://catb.org/~esr/jargon/html/F/foo.html找到了关于这两个词的解释,大概是说foo来自于华纳卡通公司的一部动画片。里面有一段居然跟汉语撤上关系:)

According to the Warner Brothers Cartoon Companion Holman claimed to have found the word “foo” on the bottom of a Chinese figurine. This is plausible; Chinese statuettes often have apotropaic inscriptions, and this one was almost certainly the Mandarin Chinese word fu (sometimes transliterated foo), which can mean “happiness” or “prosperity” when spoken with the rising tone (the lion-dog guardians flanking the steps of many Chinese restaurants are properly called “fu dogs”). English speakers' reception of Holman's ‘foo’ nonsense word was undoubtedly influenced by Yiddish ‘feh’ and English ‘fooey’ and ‘fool’.

华纳卡通公司Holman断言在中国的小雕像底下找到“foo",这有点似是而非,中国的"福"字发音确实是fu或者foo。不过英语中的"foo"可以确信是受到依地语的“feh”和英语的“fooey"和”fool“的影响。
英语不太好,大概是这个意思吧?
bar的来源大概是源于DEC的手册,后来越来越多的根foo连用在各种手册中作为变量。http://catb.org/~esr/jargon/html/F/foobar.html
http://catb.org/~esr/jargon这里关于行业用语的资料很多^^

评论:

记得以前查过这个问题,因为好多例程都拿Foo来做函数名或者类名,foo应该是指“佛”

呵,我是根据这句翻译的:
Chinese word fu, which can mean “happiness” or “prosperity”
幸福、繁荣,应该是“福”的意思吧
当然这里说的也不一定准确,只是知道个大概。

我也找了半天没找到,:(

真巧,居然搜索到你这里来了!!~~

真巧 我也搜索到你这里来了

真TM巧,我也搜来了

真TM巧,我也搜来了

真TM巧,我也搜来了

真TM巧,我也搜来了

真TM不巧,我也搜来了

真TM不巧,我也搜来了.

(选填)

(必填)

(选填)


Clicki