Hello World

Why Hello World is a common first program.
meta
Author

Troy McConaghy

Published

December 12, 2024

When learning a new computer programming language, it’s traditional to begin by writing a simple “Hello World” program, something like:

#include <stdio.h>

main()
{
    printf("Hello World\n");
}

When run on a computer, such a program is supposed to cause it to print “Hello World”. That’s all. What’s the point?

As Kernighan and Ritchie wrote in their classic book:

This is a big hurdle; to leap over it you have to be able to create the program text somewhere, compile it successfully, load it, run it, and find out where your output went. With these mechanical details, mastered, everything else is comparatively easy. (Kernighan and Ritchie 1988)

Publishing a blog post like this is a similar hurdle. To leap over it, you have to be able to write the text somewhere, convert that text to a valid web page (HTML etc.), and publish it online via some kind of web server.

I think I have everything set up now, so let’s try it out…

Hello

I made a little drawing, scanned it, converted it to an SVG file, and here’s the result:

A hand-drawn drawing of the word Hello, where the letters e and o are cartoons with eyes and mouths.

Nice. Here we go!

Back to top

References

Kernighan, Brian W., and Dennis M. Ritchie. 1988. The C Programming Language. 2nd ed. Prentice-Hall Computer Software Series. Upper Saddle River, NJ: Prentice-Hall.