History of “Hello, World”

Hello World

If you’ve taken even the smallest of baby steps toward learning a programming language, then you’ve almost certainly written a program that printed “Hello, World”, or some version of that, to your console or browser. This is the go-to, cardinal program for introductory software development tutorials and is recognized by developers of all programming languages, all over the world. Pretty much everyone remembers their first “Hello, World!” program. So, of course, you all want to know how this simple little phrase could take over the world!! Or at least make its mark on a piece of it.

According to Wikipedia, the first known documentation of a program printing “hello world” was in Brian Kernighan’s paper entitled A Tutorial Introduction to the Language B. On page 4, you see the following code:

main( ) {
  extrn a, b, c;
  putchar(a); putchar(b); putchar(c); putchar(’!*n’);
a ’hell’;
b ’o, w’;
c ’orld’;

which prints “hello, world!” to the terminal. A previous example printed “hi!” to the console, however the “hello, world!” example was added to showcase how to print a longer sentence since a character constant in B is limited to four ASCII characters. The B programming language was developed at Bell Labs by Ken Thompson and Dennis Ritchie around 1969. Dennis Ritchie then went on to create the C programming language between 1969 and 1973, which was adapted from B, and continued the alphabetical naming that was started by B. By 1973, most of the Unix operating system had been rewritten in C, due to its capacity and portability. Ritchie then joined forces with Brian Kernighan to write the unimaginably influential book, The C Programming Language in 1978. This book featured the following program:

#include <stdio.h>
main( )
    printf("hello, world\n");

which was inherited from a 1974 internal memorandum by Kernighan at Bell Labs titled Programming in C: A Tutorial.

Countless software developers, both beginners and pros, have used The C Programming Language, known to C programmers as “K&R”, to learn programming in general, and C in particular. It set the standard for technical writing and is still relevant today due to its simple statements and straightforward examples. In fact, The C Programming Language has been such an important book, that the authors’ programming style has been largely accepted as best practice. So it’s no wonder that a book that is still shaping software developers almost 40 years after it was written, would give rise to the most recognizable and reused programs in history.

And that’s how the “Hello, World!” program has become a rite-of-passage for software developers across continents and decades. It has been used to demonstrate the development of a program in a myriad of software languages and has become immortalized in the programming culture. I’ll wager that when you wrote your first “Hello, World!” program, you had no idea that you were participating in such a storied tradition and essentially rubbing shoulders with the greats! Ok, I know that sounds a little campy, but seriously…. How cool is that?!