Recess
Sign in
← Back to feed
You're reading as a guest. Sign in to save posts, see what's new, and tune your feed.
Sign in
TECHNOLOGY · BITE · 2 MIN · BEGINNER

Where 'Hello, World' Came From

Brian Kernighan put it in a 1972 tutorial because he'd seen a cartoon with a chick saying it.

In 1972, Brian Kernighan wrote an internal Bell Labs memo titled "A Tutorial Introduction to the Language B." On one of the early pages, he introduced a short example program. Its entire job was to print two words to the terminal: hello, world.

Kernighan has said in interviews that the phrase came from a cartoon he'd seen years earlier — an egg cracking open, a chick emerging, the chick saying "hello, world!" He chose it partly because it was short enough to type on a teletype without errors, and partly because it sounded friendlier than the alternatives. Earlier tutorial programs tended to print uninspiring things like "HI" or the author's initials.

When Kernighan and Dennis Ritchie co-wrote "The C Programming Language" in 1978, they carried the example into the new language. The lowercase, comma-and-space, no-exclamation-point form you still see in textbooks is directly from that book. Millions of programmers have typed it as their first working line of code.

Kernighan has said he finds the longevity funny. He also noted in a 2017 Forbes interview that he doesn't remember which cartoon it was — he's been asked a hundred times and the memory is gone.

#hello-world#brian-kernighan#c-programming#history-of-computing
Sources
Bell LabsForbes