为什么手册中函数举例都用foo()作为函数名呢?

comehope 2004-05-08 11:29:32
foo是什么单词的缩写?什么意思?
...全文
391 16 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
ccterran 2004-05-09
  • 打赏
  • 举报
回复
哈哈~~~~^_^
mistjin 2004-05-09
  • 打赏
  • 举报
回复
oh, my god!!!
www0aspsun0com 2004-05-09
  • 打赏
  • 举报
回复
我觉得就是
function object oriented
大家觉得呢?
sports98 2004-05-08
  • 打赏
  • 举报
回复
那早先咱们学这个的时候还HelloWorld呢
comehope 2004-05-08
  • 打赏
  • 举报
回复
本来叫什么也无所谓的,可是就像一个地名,一个街道名,总是有些渊源的,总不能是随机命名成 foo 的吧?还是想知道。
sports98 2004-05-08
  • 打赏
  • 举报
回复
既然是举例你还在意那么多做啥?

无所谓了,你要是喜欢随便用个非保留字的来做就是了
ccterran 2004-05-08
  • 打赏
  • 举报
回复
呵呵。http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?foo

<jargon> /foo/ A sample name for absolutely anything, especially programs and files (especially scratch files). First on the standard list of metasyntactic variables used in syntax examples. See also bar, baz, qux, quux, corge, grault, garply, waldo, fred, plugh, xyzzy, thud.

The etymology of "foo" is obscure. When used in connection with "bar" it is generally traced to the WWII-era Army slang acronym FUBAR, later bowdlerised to foobar.

However, the use of the word "foo" itself has more complicated antecedents, including a long history in comic strips and cartoons.

"FOO" often appeared in the "Smokey Stover" comic strip by Bill Holman. This surrealist strip about a fireman appeared in various American comics including "Everybody's" between about 1930 and 1952. FOO was often included on licence plates of cars and in nonsense sayings in the background of some frames such as "He who foos last foos best" or "Many smoke but foo men chew".

Allegedly, "FOO" and "BAR" also occurred in Walt Kelly's "Pogo" strips. In the 1938 cartoon "The Daffy Doc", a very early version of Daffy Duck holds up a sign saying "SILENCE IS FOO!". Oddly, this seems to refer to some approving or positive affirmative use of foo. It has been suggested that this might be related to the Chinese word "fu" (sometimes transliterated "foo"), which can mean "happiness" when spoken with the proper tone (the lion-dog guardians flanking the steps of many Chinese restaurants are properly called "fu dogs").

Earlier versions of this entry suggested the possibility that hacker usage actually sprang from "FOO, Lampoons and Parody", the title of a comic book first issued in September 1958, a joint project of Charles and Robert Crumb. Though Robert Crumb (then in his mid-teens) later became one of the most important and influential artists in underground comics, this venture was hardly a success; indeed, the brothers later burned most of the existing copies in disgust. The title FOO was featured in large letters on the front cover. However, very few copies of this comic actually circulated, and students of Crumb's "oeuvre" have established that this title was a reference to the earlier Smokey Stover comics.

An old-time member reports that in the 1959 "Dictionary of the TMRC Language", compiled at TMRC there was an entry that went something like this:

FOO: The first syllable of the sacred chant phrase "FOO MANE PADME HUM." Our first obligation is to keep the foo counters turning.

For more about the legendary foo counters, see TMRC. Almost the entire staff of what became the MIT AI LAB was involved with TMRC, and probably picked the word up there.

Another correspondant cites the nautical construction "foo-foo" (or "poo-poo"), used to refer to something effeminate or some technical thing whose name has been forgotten, e.g. "foo-foo box", "foo-foo valve". This was common on ships by the early nineteenth century.

Very probably, hackish "foo" had no single origin and derives through all these channels from Yiddish "feh" and/or English "fooey".
cloudchen 2004-05-08
  • 打赏
  • 举报
回复
记得在哪里看到过的,但不是PHP的文章

foo代表你想代表的任何东西。。。好象是这样的
sahafu89 2004-05-08
  • 打赏
  • 举报
回复
搂主是不是分太多了?呵呵,接分
caaclxf 2004-05-08
  • 打赏
  • 举报
回复
原因就是~他喜欢
demong 2004-05-08
  • 打赏
  • 举报
回复
呵呵!
mistjin 2004-05-08
  • 打赏
  • 举报
回复
一般子类都是Bar,
class Bar extends foo {
......
}
xuzuning 2004-05-08
  • 打赏
  • 举报
回复
fool —— 愚人
52juanjuan 2004-05-08
  • 打赏
  • 举报
回复
没有必要吧,这一般是一个不成名的规范而已
xylegend 2004-05-08
  • 打赏
  • 举报
回复
hello word是很经典的例子...几乎所有语言的第一个Demo程序都用它
不过PHP手册为什么用foo确实不知道....
comehope 2004-05-08
  • 打赏
  • 举报
回复
Hello World的渊源:
将Hello World程序作为第一个学写的程序,现在已经成为一种传统。该程序最早出现在由Brian Kernighan和Dennis Ritchie写的计算机程序设计教程《C编程语言》。

21,893

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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