“Hello world”在哪里? 来自?

发布于 2024-07-14 07:47:28 字数 428 浏览 7 评论 0原文

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 技术交流群。

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

发布评论

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

评论(7

箹锭⒈辈孓 2024-07-21 07:47:28

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.

enter image description here

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.

莳間冲淡了誓言ζ 2024-07-21 07:47:28

根据维基百科

虽然存在小型测试程序
自从可编程技术发展以来
计算机,使用计算机的传统
短语“你好世界!” 作为测试
消息受到示例的影响
开创性著作《The C》中的程序
编程语言。 这个例子
那本书中的程序打印“你好,
世界”(没有大写字母或
感叹号),并被继承
来自 1974 年贝尔实验室内部
布莱恩·科尼汉 (Brian Kernighan) 的备忘录,
C 编程:教程,其中
包含第一个已知版本:

<前><代码> main() {
printf("你好,世界");
}

第一个已知的用法实例
“你好”和“世界”这两个词
一起在计算机文学中
发生得更早,在 Kernighan 的 1972 年
语言教程简介
B[1],代码如下:

<前><代码>main( ) {
外部a、b、c;
putchar(a); putchar(b); putchar(c); putchar('!*n');
}
“地狱”;
弓';
c'世界';

According to wikipedia:

While small test programs existed
since the development of programmable
computers, the tradition of using the
phrase "Hello world!" as a test
message was influenced by an example
program in the seminal book The C
Programming Language. The example
program from that book prints "hello,
world" (without capital letters or
exclamation mark), and was inherited
from a 1974 Bell Laboratories internal
memorandum by Brian Kernighan,
Programming in C: A Tutorial, which
contains the first known version:

 main() {
        printf("hello, world");
 }

The first known instance of the usage
of the words "hello" and "world"
together in computer literature
occurred earlier, in Kernighan's 1972
Tutorial Introduction to the Language
B[1], with the following code:

main( ) {
  extrn a, b, c;
  putchar(a); putchar(b); putchar(c); putchar('!*n');
}
a 'hell';
b 'o, w';
c 'orld';
以可爱出名 2024-07-21 07:47:28

《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.

暖伴 2024-07-21 07:47:28

来自http://en.wikipedia.org/wiki/Hello_world_program

第一个已知的用法实例
“你好”和“世界”这两个词
一起在计算机文学中
发生得更早,在 Kernighan 的 1972 年
语言教程简介
B[1],代码如下:

<前><代码>main( ) {
外部a、b、c;
putchar(a); putchar(b); putchar(c); putchar('!*n');
}
“地狱”;
弓';
c'世界';

From http://en.wikipedia.org/wiki/Hello_world_program:

The first known instance of the usage
of the words "hello" and "world"
together in computer literature
occurred earlier, in Kernighan's 1972
Tutorial Introduction to the Language
B[1], with the following code:

main( ) {
  extrn a, b, c;
  putchar(a); putchar(b); putchar(c); putchar('!*n');
}
a 'hell';
b 'o, w';
c 'orld';
三寸金莲 2024-07-21 07:47:28

我应该在我原来的帖子中更加小心地对待这个问题——

当然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.

月亮是我掰弯的 2024-07-21 07:47:28

我第一次在印刷版中看到它(我认为)是 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.

孤凫 2024-07-21 07:47:28

来自维基百科

虽然自可编程计算机发展以来就存在小型测试程序,但使用短语“Hello world!”的传统 作为测试消息,它受到了开创性书籍《C 编程语言》中示例程序的影响。 该书中的示例程序打印“hello, world”(没有大写字母或感叹号),并继承自 1974 年贝尔实验室由 Brian Kernighan 编写的内部备忘录《C 语言编程:教程》,其中包含第一个已知版本:< /p>

< a href="http://en.wikipedia.org/wiki/Hello_world_program" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Hello_world_program

From Wikipedia

While small test programs existed since the development of programmable computers, the tradition of using the phrase "Hello world!" as a test message was influenced by an example program in the seminal book The C Programming Language. The example program from that book prints "hello, world" (without capital letters or exclamation mark), and was inherited from a 1974 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C: A Tutorial, which contains the first known version:

http://en.wikipedia.org/wiki/Hello_world_program

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