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.
Make Recess yours.
Sign in to save the ones you loved, never see the same thing twice, and tell us what you want more of.