foo 和 bar 的起源是什么?

发布于 2024-10-15 08:39:23 字数 22 浏览 2 评论 0 原文

它们来自哪里以及何时首次使用?

Where did they come from and when were they first used?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱的十字路口 2024-10-22 08:39:23

tl;dr

  • “Foo”和“bar”作为元句法变量由 MIT 和 DEC 推广,第一个参考文献是从 1964 年起在 LISP 和 PDP-1 以及 Project MAC 上的工作。

  • 其中许多人都加入了麻省理工学院的技术模型铁路俱乐部,我们在那里发现了 1959 年在技术圈中首次使用“foo”的记录(以及 1958 年的变体)。

  • “foo”和“bar”(甚至“baz”)在流行文化中都很出名,尤其是来自 Smokey Stover 和 Pogo 漫画,许多 TMRC 成员都会阅读这些漫画。

  • 此外,军方的 FUBAR 似乎也促成了它们的流行。


在 20 世纪初的流行文化中,使用单独的“foo”作为无意义词的情况已有充分记录,军事用词“FUBAR”也是如此。 (一些背景阅读:
FOLDOC
FOLDOC
行话文件
行话文件
维基百科
RFC3092


好的,让我们找一些参考资料。

停止媒体!发布此答案后,我在1938版中发现了这篇关于“foo”的完美文章。 mit.edu/V57/PDF/N57.pdf" rel="nofollow noreferrer">科技(“麻省理工学院最古老、最大的
报纸和第一份在网络上出版的报纸”),第五十七卷,第 57 号,价格三美分:

论Foo主义

The Lounger 认为 Foo-ism 的这项业务已被其被误导的支持者搞得太过分了,并特此立即表明立场,反对滥用它。
可能没有像老 foo 那样的 foo,而我们就是它,但无论如何,foo 和他的钱是某个派对。 (看台上的声音——“别犯傻了!”)

当然,作为咒骂,“foo!”在我们的语言中具有明确且可能不可替代的地位,尽管我们担心它目前的过度使用很可能会导致它过早地(唉,黑暗地)被遗忘。我们说“唉”,因为正确使用这个词可能会带来如下的幸福事件。

这是 Slater 教授在 6-120 室举办的 8.50 热力学讲座。教授盖住了黑板的正面,设置了操作升降机构的手柄,同时转向全班继续讨论。前面的木板缓缓地、庄严地升起,露出了后面的木板,木板上写着大字,拼写着“FOO”的符号!

科技报纸,一年前,给编辑的信,9 月 < 1937 年:

当火车到达车站时,新手们已经充满了 Phi Omicron Omicron(通常被称为 Foo)的荣耀故事,因此他们很容易成为猎物。

...

我并不介意我的前四个儿子被 Phi Omicron Omicron 的大宇宙兄弟会夺走,但我确实希望我的第五个儿子,我的宝贝,至少应该提前得到警告。

希望是你的,

愤怒的五个孩子的母亲。

还有The Tech1938

从言论中可以最好地解读大势所趋
在选票结束时作出。其中一票表示,“我认为我所做的事与普尔弗无关”,而另一票则只是简单地加了一个“Foo”。


科技圈中第一个有记录的“foo”可能是 1959字典TMRC 语言的

FOO:神圣音节(FOO MANI PADME HUM);只有在受到灵感与神灵交流时才可以说出来。我们的首要任务是保持 Foo 计数器转动。

这些在 FOLDOC 中进行了解释。该词典的编者皮特·萨姆森 (Pete Samson) 在 2005 年说道:

在 TMRC 使用这个词早于我来到那里。 foo 计数器可以只是随机闪烁的灯,也可以是具有模糊输入的真实计数器。

从 1996 年的 行话文件 4.0.0 开始:

该词典的早期版本源自“baz”,是斯坦福大学对 bar 的讹误。然而,皮特·萨姆森(Pete Samson)(TMRC 词典的编译者)报告说,当他 1958 年加入 TMRC 时,这个词就已经是最新的了。他说“它来自“Pogo”。鳄鱼阿尔伯特在恼怒或愤怒时会大喊“Bazz Fazz!”或“划船!”据说俱乐部的布局模仿了(神话中的)新英格兰地区的罗福克郡和巴塞克斯郡(罗福克郡与诺福克郡/萨福克郡/米德尔塞克斯郡/埃塞克斯郡混合在一起)。”

TMRC 词典早一年,1958的麻省理工学院 Voo Doo 公报(“麻省理工学院院长办公室的幽默补充”)(PDF) 在 John Banzhaf(电气工程系学生)的《墨菲与 Finagle 定律》中提到了 Foocom:

在 Foocom 和 Anarcom 联合资助下进行的进一步研究将法律扩展为包容性和普遍适用:如果有任何事情可能出错,它就会出错!

还有 1964 的 MIT Voo Doo (PDF) 引用 TMRC 用法:

是的!我想成为急功近利的雪客。给我发送以下学位:
...

  • 食物计数器

  • 富正


让我们找到代码示例中发布的“foo”、“bar”和“foobar”。

因此,术语文件 4.4.7 谈到“foobar”:

可能最初是由数字设备公司 (DEC) 在 20 世纪 60 年代和 1970 年代初通过 DEC 系统手册传播的;已确认的目击事件可以追溯到 1972 年。

我能找到的第一份已发表的参考文献是 1964 年,但写于 1963 年 6 月,编程语言 LISP:其操作和应用 由 Information International, Inc. 撰写,有许多作者,其中包括 Timothy P. Hart 和 Michael Levin:

因此,由于“FOO”本身就是一个名称,因此“COMITRIN”将以完全相同的方式对待“FOO”和“(FOO)”。

还包括其他元句法变量,例如:FOO CROCK GLITCH / POOT TOOR / ON YOU / SNAP CRACKLE POP / XYZ

我希望这与 1964 年 1 月 MIT 的 Project MAC 中的“foo”的下一个参考非常相同 的 AIM-064,或 Timothy P. Hart 和 Michael 的 LISP 练习莱文:

汽车[((FOO . CROCK) . GLITCH)]

它共享许多其他元语法变量,例如:CHI / BOSTON NEW YORK / SPINACH BUTTER STEAK / FOO CROCK GLITCH / POOT TOOP / TOOT TOOT / ISTHISATRIVIALEXCERCISE / PLOOP FLOT TOP / SNAP CRACKLE POP /一二三 / PLANE SUB THRESHER

对于“foo”和“bar”,我能找到的最早的参考资料来自麻省理工学院 1966 年 6 月的 Project MAC 的 AIM-098,或 PDP-6 LISP,作者正是 Peter Samson:

EXPLODE 与 PRIN1 一样,插入斜杠,因此 (EXPLODE (QUOTE FOO/ BAR)) PRIN1 为 (FOO // / BAR) 或 PRINC 为 (FOO / BAR)。


还有一些回忆。

@Walter Mitty 于 2008 年在此网站上回忆道:

我赞同有关 Foo Bar 的行话文件。我至少可以追溯到 1963 年,PDP-1 序列号 2,位于麻省理工学院 26 号楼的二楼。 Foo 和 Foo Bar 在那里使用,1964 年之后在 MAC 项目的 PDP-6 房间使用。

John V. Everett 在 1996 年回忆道:

当我 1966 年加入 DEC 时,foobar 已经被普遍用作一次性文件名。我相信 fubar 成为 foobar 是因为 PDP-6 支持六个字符名称,尽管我一直认为该术语是从 MIT 迁移到 DEC 的。当时 DEC 有很多 MIT 类型的人,其中一些人曾使用过 7090/7094 CTSS。由于 709x 也是 36 位机器,因此 foobar 可能已被用作那里的通用文件名。

Foo 和 bar 也常用作文件扩展名。由于当时的文本编辑器对输入文件进行操作并生成输出文件,因此从 .foo 文件编辑到 .bar 文件,然后再编辑回来是很常见的。

在使用 TECO 进行编辑时,使用 foo 来填充缓冲区也很常见。恰好填充一个磁盘块的文本字符串是 IFOO$HXA127GA$$。几乎所有与我一起工作的 PDP-6/10 程序员都使用相同的命令字符串。

丹尼尔 PB 史密斯,1998 年:

迪克·格鲁恩 (Dick Gruen) 在他的宿舍里有一个设备,通常由 B 电池、电阻器、电容器和 NE-2 霓虹灯管组成,他称之为“foo 计数器”。这大约是 1964 年左右的事。

罗伯特·舒尔登弗雷,1996 年:

使用 FOO 和 BAR 作为示例变量名至少可以追溯到 1964 年和 IBM 7070。这也可能更旧,但那是我第一次看到它的地方。这是在汇编器中。 FORTRAN 整数等效值是多少? IFOO 和 IBAR?

Paul M. Wexelblat,1992 年:

最早的 PDP-1 汇编器使用两个字符作为符号(18 位机),程序员总是留下几个单词作为补丁空间来解决问题。 (跳转到补丁空间,执行新代码,跳回)该空间通常被命名为 FU:代表 Fxxx Up,即修复 Fxxx Up 的地方。说起来,它被称为FU空间。后来的汇编器(例如,MIDAS 允许三个字符标记,因此 FU 变成了 FOO,并且所有 PDP-1 程序员都会告诉您那是 FOO 空间。

Bruce B. Reynolds

FOO(FU)BAR的IBM端是使用BAR端作为基址寄存器;在 1970 年代中期,CICS 程序员不得不担心各种 xxxBAR...我认为其中之一就是 FRACTBAR...

这是一个直接的 IBM "BAR"(1955 年)。


其他早期参考文献:


我还没找到如 RFC3092 和其他地方所建议的那样,将 foo bar 引用为“反向 foo 信号”。

以下是一些更早的 F00,但我认为它们是巧合/误报:

tl;dr

  • "Foo" and "bar" as metasyntactic variables were popularised by MIT and DEC, the first references are in work on LISP and PDP-1 and Project MAC from 1964 onwards.

  • Many of these people were in MIT's Tech Model Railroad Club, where we find the first documented use of "foo" in tech circles in 1959 (and a variant in 1958).

  • Both "foo" and "bar" (and even "baz") were well known in popular culture, especially from Smokey Stover and Pogo comics, which will have been read by many TMRC members.

  • Also, it seems likely the military FUBAR contributed to their popularity.


The use of lone "foo" as a nonsense word is pretty well documented in popular culture in the early 20th century, as is the military FUBAR. (Some background reading:
FOLDOC
FOLDOC
Jargon File
Jargon File
Wikipedia
RFC3092)


OK, so let's find some references.

STOP PRESS! After posting this answer, I discovered this perfect article about "foo" in the Friday 14th January 1938 edition of The Tech ("MIT's oldest and largest
newspaper & the first newspaper published on the web"), Volume LVII. No. 57, Price Three Cents:

On Foo-ism

The Lounger thinks that this business of Foo-ism has been carried too far by its misguided proponents, and does hereby and forthwith take his stand against its abuse.
It may be that there's no foo like an old foo, and we're it, but anyway, a foo and his money are some party. (Voice from the bleachers- "Don't be foo-lish!")

As an expletive, of course, "foo!" has a definite and probably irreplaceable position in our language, although we fear that the excessive use to which it is currently subjected may well result in its falling into an early (and, alas, a dark) oblivion. We say alas because proper use of the word may result in such happy incidents as the following.

It was an 8.50 Thermodynamics lecture by Professor Slater in Room 6-120. The professor, having covered the front side of the blackboard, set the handle that operates the lift mechanism, turning meanwhile to the class to continue his discussion. The front board slowly, majestically, lifted itself, revealing the board behind it, and on that board, writ large, the symbols that spelled "FOO"!

The Tech newspaper, a year earlier, the Letter to the Editor, September 1937:

By the time the train has reached the station the neophytes are so filled with the stories of the glory of Phi Omicron Omicron, usually referred to as Foo, that they are easy prey.

...

It is not that I mind having lost my first four sons to the Grand and Universal Brotherhood of Phi Omicron Omicron, but I do wish that my fifth son, my baby, should at least be warned in advance.

Hopefully yours,

Indignant Mother of Five.

And The Tech in December 1938:

General trend of thought might be best interpreted from the remarks
made at the end of the ballots. One vote said, '"I don't think what I do is any of Pulver's business," while another merely added a curt "Foo."


The first documented "foo" in tech circles is probably 1959's Dictionary of the TMRC Language:

FOO: the sacred syllable (FOO MANI PADME HUM); to be spoken only when under inspiration to commune with the Deity. Our first obligation is to keep the Foo Counters turning.

These are explained at FOLDOC. The dictionary's compiler Pete Samson said in 2005:

Use of this word at TMRC antedates my coming there. A foo counter could simply have randomly flashing lights, or could be a real counter with an obscure input.

And from 1996's Jargon File 4.0.0:

Earlier versions of this lexicon derived 'baz' as a Stanford corruption of bar. However, Pete Samson (compiler of the TMRC lexicon) reports it was already current when he joined TMRC in 1958. He says "It came from "Pogo". Albert the Alligator, when vexed or outraged, would shout 'Bazz Fazz!' or 'Rowrbazzle!' The club layout was said to model the (mythical) New England counties of Rowrfolk and Bassex (Rowrbazzle mingled with (Norfolk/Suffolk/Middlesex/Essex)."

A year before the TMRC dictionary, 1958's MIT Voo Doo Gazette ("Humor suplement of the MIT Deans' office") (PDF) mentions Foocom, in "The Laws of Murphy and Finagle" by John Banzhaf (an electrical engineering student):

Further research under a joint Foocom and Anarcom grant expanded the law to be all embracing and universally applicable: If anything can go wrong, it will!

Also 1964's MIT Voo Doo (PDF) references the TMRC usage:

Yes! I want to be an instant success and snow customers. Send me a degree in:
...

  • Foo Counters

  • Foo Jung


Let's find "foo", "bar" and "foobar" published in code examples.

So, Jargon File 4.4.7 says of "foobar":

Probably originally propagated through DECsystem manuals by Digital Equipment Corporation (DEC) in 1960s and early 1970s; confirmed sightings there go back to 1972.

The first published reference I can find is from February 1964, but written in June 1963, The Programming Language LISP: its Operation and Applications by Information International, Inc., with many authors, but including Timothy P. Hart and Michael Levin:

Thus, since "FOO" is a name for itself, "COMITRIN" will treat both "FOO" and "(FOO)" in exactly the same way.

Also includes other metasyntactic variables such as: FOO CROCK GLITCH / POOT TOOR / ON YOU / SNAP CRACKLE POP / X Y Z

I expect this is much the same as this next reference of "foo" from MIT's Project MAC in January 1964's AIM-064, or LISP Exercises by Timothy P. Hart and Michael Levin:

car[((FOO . CROCK) . GLITCH)]

It shares many other metasyntactic variables like: CHI / BOSTON NEW YORK / SPINACH BUTTER STEAK / FOO CROCK GLITCH / POOT TOOP / TOOT TOOT / ISTHISATRIVIALEXCERCISE / PLOOP FLOT TOP / SNAP CRACKLE POP / ONE TWO THREE / PLANE SUB THRESHER

For both "foo" and "bar" together, the earliest reference I could find is from MIT's Project MAC in June 1966's AIM-098, or PDP-6 LISP by none other than Peter Samson:

EXPLODE, like PRIN1, inserts slashes, so (EXPLODE (QUOTE FOO/ BAR)) PRIN1's as (F O O // / B A R) or PRINC's as (F O O / B A R).


Some more recallations.

@Walter Mitty recalled on this site in 2008:

I second the jargon file regarding Foo Bar. I can trace it back at least to 1963, and PDP-1 serial number 2, which was on the second floor of Building 26 at MIT. Foo and Foo Bar were used there, and after 1964 at the PDP-6 room at project MAC.

John V. Everett recalls in 1996:

When I joined DEC in 1966, foobar was already being commonly used as a throw-away file name. I believe fubar became foobar because the PDP-6 supported six character names, although I always assumed the term migrated to DEC from MIT. There were many MIT types at DEC in those days, some of whom had worked with the 7090/7094 CTSS. Since the 709x was also a 36 bit machine, foobar may have been used as a common file name there.

Foo and bar were also commonly used as file extensions. Since the text editors of the day operated on an input file and produced an output file, it was common to edit from a .foo file to a .bar file, and back again.

It was also common to use foo to fill a buffer when editing with TECO. The text string to exactly fill one disk block was IFOO$HXA127GA$$. Almost all of the PDP-6/10 programmers I worked with used this same command string.

Daniel P. B. Smith in 1998:

Dick Gruen had a device in his dorm room, the usual assemblage of B-battery, resistors, capacitors, and NE-2 neon tubes, which he called a "foo counter." This would have been circa 1964 or so.

Robert Schuldenfrei in 1996:

The use of FOO and BAR as example variable names goes back at least to 1964 and the IBM 7070. This too may be older, but that is where I first saw it. This was in Assembler. What would be the FORTRAN integer equivalent? IFOO and IBAR?

Paul M. Wexelblat in 1992:

The earliest PDP-1 Assembler used two characters for symbols (18 bit machine) programmers always left a few words as patch space to fix problems. (Jump to patch space, do new code, jump back) That space conventionally was named FU: which stood for Fxxx Up, the place where you fixed Fxxx Ups. When spoken, it was known as FU space. Later Assemblers ( e.g. MIDAS allowed three char tags so FU became FOO, and as ALL PDP-1 programmers will tell you that was FOO space.

Bruce B. Reynolds in 1996:

On the IBM side of FOO(FU)BAR is the use of the BAR side as Base Address Register; in the middle 1970's CICS programmers had to worry out the various xxxBARs...I think one of those was FRACTBAR...

Here's a straight IBM "BAR" from 1955.


Other early references:


I haven't been able to find any references to foo bar as "inverted foo signal" as suggested in RFC3092 and elsewhere.

Here are a some of even earlier F00s but I think they're coincidences/false positives:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文