If you have ever learned a programming language, chances are the first line of code you ever wrote printed two simple words to your screen, Hello, World! It is so universal that it has become a rite of passage for every developer, from beginners writing their first Python script to seasoned engineers picking up a new language. But have you ever stopped to wonder where this tradition came from? Why not "Hi there!" or "Testing 123"? The answer is a fascinating piece of computing history that traces back over five decades.
Where It All Began
The phrase "Hello, World!" as a programming example is widely credited to Brian Kernighan, one of the most influential computer scientists in history.
In 1972, Kernighan used it in an internal Bell Laboratories memo titled "A Tutorial Introduction to the Language B", B being a precursor to the C programming language. This was likely the first time the phrase appeared in a programming context, though in that version it was written without the comma and in lowercase.
The example became truly famous when Kernighan and Dennis Ritchie, the creator of the C programming language published "The C Programming Language" in 1978, a book so influential it is simply known in developer circles as K&R. The very first example in that book was a program that printed: hello, world
That book went on to become one of the most widely read programming books of all time, and with it, the tradition of beginning with "Hello, World!" was cemented into programming culture forever.
Why "Hello, World!" Specifically?
The choice of the phrase was not accidental. A "Hello, World!" program is the simplest possible program that produces visible output. It serves a very specific and practical purpose; it verifies that
- Your development environment is correctly set up.
- The compiler or interpreter is working.
- Your code can successfully execute and produce output.
- The connection between your code and the screen is functioning.
In other words, it is not about the words themselves. It is about confirming that the entire system works end to end. The phrase "Hello, World!" just happens to be friendly, readable and universally understood, a small greeting from the machine to the programmer saying "everything is working; we are good to go."
What started as a simple example in a Bell Laboratories tutorial has since been translated into virtually every programming language ever created. From C to Python, JavaScript to Rust, Swift to Go, every language has its own version of Hello, World! and learning communities around the world use it as the universal starting point.