“Hello world”在哪里? 来自?
“hello, world
”通常是任何编程语言的第一个示例。 我一直想知道这句话是从哪里来的,又是在哪里第一次使用的。
我曾经被告知这是有史以来在计算机屏幕上显示的第一句话,但我找不到任何对此的参考。
所以我的问题是:
使用“hello, world
”作为计算机语言的第一个示例的做法源自何处?
它最初是在哪里使用的?
更新
虽然答案很有趣,但我应该指出我已经阅读了维基百科的文章。 它确实回答了有关文献中首次使用的问题,但没有回答“hello world
”首次使用的时间。
所以我认为可以肯定地得出这样的结论:这不是第一个在计算机屏幕上显示的句子,并且没有关于它第一次使用的时间的记录?
'hello, world
' is usually the first example for any programming language. I've always wondered where this sentence came from and where was it first used.
I've once been told that it was the first sentence ever to be displayed on a computer screen, but I've not been able to find any reference to this.
So my question is:
Where does the practice to use 'hello, world
' as the first example for computer languages originate from?
Where was it first used?
Update
Although the answers are quite interesting, I should have noted that I had read the Wikipedia article. It does answer the question about the first use in literature, but does not answer when 'hello world
' was first used.
So I think that it is safe to conclude that it was not the first sentence ever to be displayed on a computer screen and that there is no record about when it was first used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Brian Kernighan 实际上编写了第一个“hello, world”程序,作为 Martin Richards 开发的 BCPL 编程语言文档的一部分。 1972 年 Kernighan 和 Ritchie 的 C 书籍出版前几年,贝尔实验室在开发 C 时使用了 BCPL。
作为我正在撰写的一本有关 Alice 编程环境的书的研究的一部分,我与普林斯顿大学的 Kernighan 教授和剑桥大学的 Martin Richards 都有通信(20 世纪 90 年代我在那里教授研讨会时)。 他们帮助我追踪了第一个有记录的使用代码来打印消息“Hello, World!”的情况。 Brian Kernighan 记得为 BCPL 手册的 I/O 部分编写了部分代码——他似乎拥有大量笔记、旧文档等——找到了手册并确认这是原始手册。该代码最初用于 C 编译器的测试,并被写入 Kernighan 和 Ritchie 的书中,后来成为用于测试 Bjarne Stroustrup 的 C++ 编译器的首批程序之一,并
成为新程序员的标准 。在它出现在克尼根和里奇之后,
可能是有史以来最畅销的编程入门书籍。
Brian Kernighan actually wrote the first "hello, world" program as part of the documentation for the BCPL programming language developed by Martin Richards. BCPL was used while C was being developed at Bell Labs a few years before the publication of Kernighan and Ritchie's C book in 1972.
As part of the research for a book I was writing about the Alice programming environment, I corresponded with both Prof. Kernighan at Princeton and Martin Richards at Cambridge (when I was teaching a seminar there in the 1990’s). They helped me to track the first documented use of code to print the message "Hello, World!” Brian Kernighan remembered writing the code for part of the I/O section of the BCPL manual. Martin Richards -- who seems to have a treasure trove of notes, old documents, etc. -- found the manual and confirmed that this was the original appearance of the program. The code was used for early testing of the C compiler and made its way into Kernighan and Ritchie's book. Later, it was one of the first programs used to test Bjarne Stroustrup's C++ compiler.
It became a standard for new programmers after it appeared in Kernighan and Ritchie, which
is probably the best selling introduction to programming of all time.
根据维基百科:
According to wikipedia:
《C 编程语言》一书中的第一个 C 程序是打印“hello world!” 屏幕上。
从那时起,它就被用作第一个介绍编程语言基本细节的程序。
The first C program in the book "The C Programming Language" was to print "hello world!" on the screen.
Since then it is used as the first program to introduce the basic details of a programming language.
来自http://en.wikipedia.org/wiki/Hello_world_program:
From http://en.wikipedia.org/wiki/Hello_world_program:
我应该在我原来的帖子中更加小心地对待这个问题——
当然Barlop是对的,K&R 于 1978 年发表。我的帖子中缺少一个昏迷。 我的意思是带有 Kernighan 博士的 Hello World 代码的 BCPL 手册的日期是 1972 年。引用此内容的备忘录是 1974 年的。Martin
Richards 有这些文件。 我有一份损坏的手册复印件和一份备忘录副本。
我相信原文没有标点符号。
BCPL和B代码几乎同时出现。 我一直认为 therefromhere 引用的 B 代码是第一位的,但 Martin Richards 似乎认为 BCPL 代码是第一位的。 无论哪种情况,“Hello Word!” 它早于 K&R,其代码中第一个有记录的使用似乎是由贝尔实验室的 Brian Kernighan 编写的。
I should have been more careful with language in my original post about this --
Of course Barlop is right, K&R was published in 1978. A coma was missing in my post. I meant that the BCPL manual with Dr. Kernighan's Hello World code was dated 1972. The memorandum with a reference to this is from 1974.
Martin Richards has these documents. I have a bad photocopy of the manual and a copy of the memorandum.
I believe the original had no punctuation.
The BCPL and the B code appeared almost at the same time. I always thought the B code cited by therefromhere came first, but Martin Richards seemed to think the BCPL code was first. In either case, "Hello Word!" predates K&R, and its first documented use in code appears to have been written by Brian Kernighan at Bell Labs.
我第一次在印刷版中看到它(我认为)是 K&R 的第一版,所以大约是 1982 年,但在那之前我就已经在编写自己的“Hello world”程序了,就像其他人一样。
First time I came across it in print was (I think) the first edition of K&R, so tha would have been circa 1982, but I'd been writing my own "Hello world" programs long before that, as had everyone else.
来自维基百科
< a href="http://en.wikipedia.org/wiki/Hello_world_program" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Hello_world_program
From Wikipedia
http://en.wikipedia.org/wiki/Hello_world_program