“ foo”和“ bar”是什么意思,为什么人们喜欢用它们作为示例? [重复]
This question already has an answer here:
In many program test case or example case, i always see "bar" and "foo", what is the two word represent for and why choose this two words as example?
</div>
此问题已经存在 在这里有一个答案: p>
-
foo和bar的起源是什么? [关闭]
2个答案
span>
li>
\ n ul>
div>
在许多程序测试案例或示例案例中,我总是看到“ bar”和“ foo”,这两个词代表什么,为什么选择 这两个词为例? p> div>
Google can answer your question far better than I. From wiki:
The word foo originated as a nonsense word from the 1930s, the military term FUBAR emerged in the 1940s, and the use of foo in a programming context is generally credited to the Tech Model Railroad Club (TMRC) of MIT from circa 1960.[9] However, the precise relationship of these terms is not known with certainty, and several anecdotal theories have been advanced to identify them.
Also, have a look at this question: What is the origin of foo and bar? as well as this one: https://softwareengineering.stackexchange.com/questions/69788/what-is-the-history-of-the-use-of-foo-and-bar-in-source-code-examples