关于英文单词 foo 到底是什么意思

2020-11-07 18:56:03 +08:00
 VHacker1989

我在很多示例代码都喜欢用这个单词,查了下有道说是函数的意思,感觉在很多示例代码中又不像这个意思

3451 次点击
所在节点    English
24 条回复
lcdtyph
2020-11-07 19:03:40 +08:00
placeholder,简单来说当你不知道取个什么名字,而且名字不重要的时候就可以用 foo,bar,foobar 来占位

就类似指代人名时候的张三、李四
rogwan
2020-11-07 19:07:25 +08:00
foo 是 fu 的变体缩写,有 function 的意思,也有 fuck-up 的意思。
JJstyle
2020-11-07 19:19:35 +08:00
https://en.wikipedia.org/wiki/Foobar#History_and_etymology

...he used the word due to having seen it on the bottom of a jade Chinese figurine in San Francisco Chinatown, purportedly signifying "good luck".[3] If true this is related to the Chinese word fu ("福", sometimes transliterated foo), which can mean happiness or blessing.
loading
2020-11-07 19:28:35 +08:00
@JJstyle 我差点信了。
BrettD
2020-11-07 19:45:28 +08:00
“小明”的意思
Qlccks2
2020-11-07 19:47:03 +08:00
foo bar
张三 李四
小明 小红
qiayue
2020-11-07 20:04:46 +08:00
假设你是 foo,你的朋友 bar 正在参加每果大选,在结果即将出来之前,请你用英文写一封信给 bar……
anguiao
2020-11-07 20:06:12 +08:00
比 test 看起来逼格高一点,仅此而已
delectate
2020-11-07 20:41:57 +08:00
路人甲的意思。
ethanlu
2020-11-07 20:49:21 +08:00
foobar

(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.)
ybbswc
2020-11-07 20:53:11 +08:00
路人甲,路人乙。
李雷,韩梅梅。
Mutoo
2020-11-07 20:57:14 +08:00
chihiro2014
2020-11-07 21:07:33 +08:00
甲乙丙丁
gainsurier
2020-11-07 21:18:07 +08:00
foobar,福报。
1more
2020-11-07 21:29:15 +08:00
foo = example1
bar = example2
imn1
2020-11-07 21:37:51 +08:00
foo 福
bar 报
zsdroid
2020-11-07 22:09:25 +08:00
这个问题和我刚学 java 泛型时问 T 是什么意思一样
oneisall8955
2020-11-07 22:52:17 +08:00
var foo = bar
yeqizhang
2020-11-07 23:02:26 +08:00
我第一次看到这个时,因为我只会简单英语,首先就读 fool,联想到傻瓜....
dcalsky
2020-11-08 00:47:54 +08:00
三个的时候用:'foo' 'bar' 'baz'
单个的时候可以用: 'foobar'或者'foo'
为什么:总比 test, shit, fuck 的要好....

算法代码一般用 ijkmn, 而 foo bar 一般的用在 demo code 里

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/722750

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX