一个简单的问题 foo

dreamsky15 2006-03-09 11:28:56
很多java代码例子都有个叫 foo 的变量,
他究竟代表什么意思呢?
一直搞不懂。
比如 int i;
i 是代表 integer
那 foo代表什么?
...全文
188 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dreamsky15 2006-03-16
  • 打赏
  • 举报
回复
谢谢。
金山糍粑里也找不到这类词汇。
我也找到一些资料:

技术文档中经常出现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这里关于行业用语的资料很多^^


----
有点明白了。
interpb 2006-03-09
  • 打赏
  • 举报
回复
正解

呵呵
tomuno 2006-03-09
  • 打赏
  • 举报
回复
foo和bar在国外的意思相当于国内的某某,如张三,李四,王二麻子等

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧