Monday, June 8, 2015

Me too: "Hello, world", not Only the Chick

And finally, I am blogging... 

Several ideas stormed my mind during the previous couple of years, but I've been overwhelmed with my PhD (well, now I am even more busy :); finally, I decided to share my ideas, hopefully, they could benefit someone, someday, somewhere, somehow, some$$...

Having a pile of accumulated blog post ideas in my head, it wasn't easy to decide which one should go first. Not to act as a Buridan's Ass [1], I simply started with the classical "Hello, world", but this time a post, not a program. 

Okay, but what is interesting in "Hello, world"?

Nothing but curiosity. You seldom read a programming language book or tutorial without "Hello, world" as an example, and probably every programmer on the globe wrote such a program (at least from 1980 on); but where did this phrase come from? When was it first mentioned? Who invented it?
I did a small research about the subject, and here are the answers.

Ken Thompson (sitting) and Dennis Richie using a
PDP-11 computer.

First appearance in books?

In fact, the "hello, world" phrase gained its celebrity since 1978, as it appeared in the famous book "The C Programming Language" [2] of Brian Kernighan and Dennis Ritchie (the C and UNIX pioneer together with Ken Thompson). And it seems that this was the first programming book ever to mention this phrase [5]. The first piece of "hello, world" C code was even sold at The Algorithm Auction. 

First documented?

Brian Kernighan in youth.
Even four years prior to that, "hello, world" was documented in the internal memorandum of the Bell Labs "Programming in C - A Tutorial" [3] by Brian Kernighan. His C book co-author Dennis Ritchie mentions, ohis webpage, that the first instance of "hello, world" program actually appeared in Kernighan's tutorial: "A TUTORIAL INTRODUCTION TO THE LANGUAGE B" [4] as part of the Bell Labs "Technical Report #8: The Programming Language B", published in January 1973 [5].

According to Charles (or Chuck) W. Herbert [6] (the author of "An Introduction to Programming Using Alice" book), the "hello, world" even predates Kernighan's tutorial. C. Herbert met both Brian Kernighan and Martin Richards (the BCPL language developer) at Cambridge in 1990, and Brian remembered writing the code in the draft I/O section of the BCPL manual at Bell Labs in 1972. Martin also confirmed that from a treasure of old documents he has. (It seems both M. Richards and C. Herbert have copies of the 1972 Bel Labs BCPL tutorial, not the published one that refers to 1974; I would be grateful if you came across an e-copy and sent it to me.) 
This is how the first "hello, world" looked like.

Nonetheless, this does not actually contradict Dennis Ritchie's narrative, since B and BCPL appeared almost at the same time at Bell Labs, and the "Technical Report #8" of Bell Labs was published in January, 1973. This strongly supports the claim that "hello, world" first appeared in 1972.

But why "Hello, world"?

I hope you liked this post, and I leave you with Brian Kernighan himself answering this question to Forbes magazine in his interview "Brian Kernighan: No one Thought C Would Become So Big [7]:

                        "Memory is dim now. What I do remember is that I had seen a cartoon that showed an egg and a chick and the chick was saying, “Hello, world”."...

References and readings:

[1]. Lamport, Leslie. "Buridan’s principle." Currently available from http://research. microsoft. com/users/lamport/pubs/pubs. html, or by searching the Web for the(1984).
[2]. Kemighan, B. W., & Ritchie, D. M. (1978). The C programming language. Bell Telephone Laboratories, Incorporated, Englewood Cliffs, NJ.
[3]. Kernighan, B. W. (1974). ‘Programming in C− A Tutorial. Internal memorandum, Bell Laboratories
[4]. Kernighan, B. W. A Tutorial Introduction to the Language B.
[5] Seibel, P. (2005). Practical common lisp. Apress.
[6] StackOverflow. Available on September 2015.
[7]. Forbesindia magazine. Brian Kernighan: No one Thought C Would Become So Big. Available on September 2015.

No comments:

Post a Comment