A Laboratory of Legends
To understand the decision, you have to picture the scene: Bell Labs in the 1970s. This wasn't just any corporate research center; it was the cradle of modern computing. Here, a small group of brilliant minds, including Ken Thompson and Dennis Ritchie,
were creating the foundational tools that still power our world. They developed the Unix operating system and the C programming language, not as commercial products, but as better ways to get their own work done. Within this hotbed of innovation was Brian Kernighan, a computer scientist tasked with, among other things, writing documentation for these new tools. The atmosphere was informal, pragmatic, and driven by an ethos of simplicity and elegance—a philosophy that would profoundly shape Kernighan's famous decision.
The Problem of the First Step
When you invent a new programming language, you face a fundamental challenge: how do you teach it to someone? More importantly, how do you give a new programmer a quick, satisfying win? The first program can't be too complex, or it will be discouraging. But it also has to be meaningful enough to prove that the entire system—the editor, the compiler, the linker, and the operating system—is working correctly. Seeing a result on the screen, any result, is a crucial first victory. Kernighan encountered this exact problem while writing a tutorial for a predecessor to C, a language called B, in 1972. He needed a simple program that would do one thing: print a short message to the screen.
Not Genius, but Pragmatism
The “untold story” is that there was no lightning bolt of inspiration. Kernighan himself admits his memory is dim on the exact origin, but he believes he borrowed the phrase from a cartoon he'd seen of a chick hatching from an egg and chirping, “Hello, World!”. The phrase had also appeared in documentation for an even earlier language, BCPL. It was a pre-existing meme within the small Bell Labs community. The decision wasn't about the specific words, but the function. The program, `printf("hello, world");`, was the perfect test. It was self-contained, simple to type, and provided immediate, visible feedback. It was a complete, working program in a single line of meaningful code, a stark contrast to the verbose startup programs required by older languages. This choice to reuse a simple, friendly phrase and package it into the smallest possible useful program was an act of pure pragmatism.
From a Memo to a Movement
That simple example might have remained an internal Bell Labs footnote. Its journey to iconic status began in 1978, with the publication of “The C Programming Language” by Kernighan and Dennis Ritchie. This book, known to generations of programmers as simply “K&R,” became the bible of the C language. And on page six, the very first example program was the one that printed “hello, world”. As C and Unix exploded in popularity, fueled by affordable minicomputers like the PDP-11, K&R was the manual. Millions of programmers, one by one, typed those two words as their entry into this new world. It became a rite of passage, a shared experience that connected a global community. New languages that followed, from Java to Python to Rust, adopted the tradition, cementing its place in programming culture.













