Why 'Hello, World' Is Every Programmer's First Program
The story behind the 'Hello, World' tradition — how it spread from a 1970s C tutorial, and why printing one line is still the smartest first thing you do in any new language.
Open almost any programming tutorial and the very first thing it asks you to do is make the computer print the words Hello, World. It is so universal that it feels like a law of nature. It isn’t — it is a tradition with a traceable origin and a genuinely good reason to exist.
Where the tradition comes from
The phrase entered the mainstream through The C Programming Language, the 1978 book by Brian Kernighan and Dennis Ritchie (so influential that programmers just call it “K&R”). Its opening example is a tiny C program that prints hello, world, and because that book became the canonical text for an entire generation of programmers, the example was copied, taught, and re-taught until it became the default way to start.
Kernighan had used a similar greeting even earlier, in a tutorial he wrote for the B language — the predecessor to C. So the lineage runs from an early B tutorial, through the K&R C book, and out into essentially every language and platform that came afterward. Today you will find an official “Hello, World” example in the docs for Python, Rust, Go, JavaScript, and basically anything else, often phrased almost identically out of pure homage.
The exact punctuation and capitalization were never standardized. The original was lowercase with no exclamation mark; modern versions often write Hello, World!. Nobody enforces a canonical form, which is part of the charm.
Why it survives: it’s a toolchain smoke test
The deeper reason the tradition stuck is that the program does something quietly useful. Printing one line is the smallest complete program that exercises every stage of your setup. To get those words on screen, a lot of machinery has to be wired up correctly:
- You need a working editor and a file saved in the right place.
- You need a compiler or interpreter that can find, parse, and process your file.
- You need a runtime — the language’s standard library and whatever runs the result — so that “print this text” actually reaches your terminal.
If any link in that chain is broken — a missing compiler, a wrong PATH, an unactivated virtual environment, a misconfigured build tool — the program fails before you have written a single line of real logic. That is exactly what you want early. A one-line program separates two very different questions: “Is my environment set up correctly?” and “Is my code correct?” By answering the first one in isolation, you make every later bug easier to reason about, because you already trust the floor you’re standing on.
print("Hello, World!")#include <stdio.h>
int main(void) { printf("hello, world\n"); return 0;}Notice how much more the C version reveals. To run it you must invoke a compiler, link the standard library, and execute the resulting binary. If Hello, World prints, you have just confirmed that an entire compile-link-run pipeline works on your machine.
How to use it well
Treat Hello, World as a deliberate checkpoint, not a ritual you skip past. Whenever you install a new language, set up a new project, or move to a new machine or container, run the smallest possible program first. In a compiled language, that proves the build pipeline. In a web framework, “Hello, World” usually means getting a single route to return a string — which quietly confirms the server starts, binds a port, and routes a request. The pattern scales: the goal is always to verify the plumbing with the least amount of code that can possibly fail.
FAQ
Did Kernighan and Ritchie invent 'Hello, World'?+
Why print 'Hello, World' instead of doing something more useful?+
Is 'Hello, World' still relevant with modern tooling?+
Related reading
2026-06-04
ACID vs BASE: What Database Guarantees Actually Promise
ACID and BASE describe two ends of a tradeoff between strict correctness and scalable availability. Learn what each guarantee means, when each fits, and why most modern databases sit somewhere in between.
2026-06-04
Big-Endian vs Little-Endian
Byte order explained: how big-endian and little-endian lay out multi-byte numbers in memory, why network protocols pick one, and when the difference actually bites you.
2026-06-04
Big-O Notation in Plain English
Big-O describes how an algorithm's runtime or memory grows as input grows. Learn the common classes — O(1), O(log n), O(n), O(n log n), O(n^2), O(2^n) — with plain examples.
2026-06-04
CORS in Plain English: Why the Browser Blocks Your Fetch
A clear walkthrough of CORS and the same-origin policy — what an origin is, why your fetch fails, how servers opt in, and the big misconception about who CORS actually protects.
2026-06-04
Environment Variables and PATH, Explained
What environment variables actually are, why they hold config and secrets, and how PATH decides which binary runs when you type a command.
Get the best tools, weekly
One email every Friday. No spam, unsubscribe anytime.