"foo" 和 "bar" 是什么意思,为什么人们喜欢用它们作为示例?

what does "foo" and "bar" mean and why people like use them as example case?

在很多程序测试用例或示例用例中,我总是看到"bar"和"foo",这两个词代表什么,为什么选择这两个词作为示例?

Google 比我更能回答你的问题。来自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.

另外,看看这个问题: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