The Origins of
"Hello, World!"
How two simple words became the universal first step in every programmer's journey
The First Hello
main() {
printf("hello, world\n");
}
In 1972, Brian Kernighan wrote an internal Bell Labs memo titled "A Tutorial Introduction to the Language B." In it, he presented what may be the first known example of a program that simply printed a greeting to the world. The code was humble, almost mundane—yet it would become one of the most replicated snippets in computing history.
The exact phrase "hello, world" (lowercase, with a comma) appeared in this tutorial as the canonical example of a minimal, working program. It served a simple pedagogical purpose: demonstrate that the language works, that output is possible, and that you—yes, you—can make the computer speak.
The C Programming Language
"The only way to learn a new programming language is by writing programs in it."
— Brian W. Kernighan & Dennis M. Ritchie
When Brian Kernighan and Dennis Ritchie published The C Programming Language in 1978, they immortalized "Hello, World!" in what would become known as "The White Book" or simply "K&R." This wasn't just any programming book—it became the definitive reference for C, selling millions of copies and teaching generations of programmers.
The book's first example program was, naturally, Hello World. But there was a subtle change: the 'H' was now capitalized, and the punctuation varied in different editions. The 1978 first edition showed:
#include <stdio.h>
main()
{
printf("hello, world\n");
}
Why "Hello, World!"?
Simplicity
The program is minimal enough to type in minutes, even for beginners. It requires no complex logic, no input, no variables to track. Just output.
Immediate Feedback
You compile, you run, you see results instantly. There's magic in seeing your words appear on screen—proof that you've bridged the gap between human and machine.
Universal Test
It verifies your environment works: compiler, linker, runtime, standard library. If Hello World runs, you're ready to program.
A Friendly Greeting
Programming can be intimidating. But starting with "Hello, World!" is like the computer waving back, saying "I'm here, and I'm ready to work with you."
The Spread of a Tradition
From C, the tradition spread like wildfire. Every new programming language tutorial, every textbook, every online course seemed to begin the same way. Even languages that predated K&R's book retroactively adopted Hello World as their canonical first program.
By the 1980s and 1990s, "Hello, World!" had transcended C. It appeared in:
- Pascal textbooks teaching structured programming
- BASIC manuals for home computer enthusiasts
- Java courses at universities worldwide
- Python tutorials for beginners
- JavaScript examples in web development
Today, you can find Hello World implementations in hundreds of languages—from mainstream ones like Python and JavaScript to esoteric languages like Brainfuck and Shakespeare. Each one is a small tribute to Kernighan's original example.
Before "Hello, World!"
What did programmers write before 1972? Early programming examples were often mathematical:
- Computing factorial of a number
- Calculating Fibonacci sequences
- Solving quadratic equations
- Simple arithmetic demonstrations
These were pedagogically sound but lacked personality. They treated the computer as a calculating machine rather than a communication device. "Hello, World!" changed that—it acknowledged that programming is about communication, about making machines speak in human language.
Variations Through Time
The exact phrasing has evolved:
"hello, world\n"
Original B language version, lowercase
"hello, world"
Early C tutorial versions
"hello, world\n"
K&R first edition
"Hello, World!"
Modern convention: capitalized, with exclamation
Cultural Impact
"Hello, World!" has become more than a program—it's a rite of passage, a cultural artifact, a shared experience across generations of programmers. It's:
A Greeting
Your first conversation with a machine
A Tradition
Passed down through textbooks and tutorials
A Test
The simplest way to verify a system works
Universal
Recognized by programmers worldwide
The Man Behind the Message
Brian Wilson Kernighan
Computer Scientist, Bell Labs & Princeton University
Born in 1942 in Toronto, Canada, Brian Kernighan is a legendary computer scientist whose influence on programming is immeasurable. At Bell Labs, he worked alongside Dennis Ritchie and Ken Thompson during the creation of Unix. Beyond co-authoring The C Programming Language, he contributed to AWK (the 'K' stands for Kernighan), and wrote numerous influential books on programming.
Kernighan has said in interviews that he doesn't remember the exact origin of "hello, world"—it was simply a natural, friendly example. He may not have realized that these two words would echo through computer science education for over half a century, typed by millions of aspiring programmers taking their first steps into code.
Now a professor emeritus at Princeton University, Kernighan continues to teach and write about computing, programming languages, and the craft of software development.
A Living Tradition
Today, every new programming language, every new framework, every new developer begins the same way. Whether it's printed to a terminal, displayed in a browser, or spoken by a voice assistant—"Hello, World!" remains our first program.
It's a reminder that behind every complex system, every sophisticated application, every line of production code, there was once a beginner typing those two simple words, seeing them appear on screen, and feeling the thrill of creation.
"Hello, World!" isn't just a program—it's where every journey begins.