pickuma.
Dev Knowledge

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.

5 min read

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'?+
They popularized it. The example in their 1978 C book is what made it ubiquitous, but Kernighan had used a similar greeting earlier in a tutorial for the B language, C's predecessor. The phrase itself wasn't a formal invention so much as a convention that spread because the book was so widely read.
Why print 'Hello, World' instead of doing something more useful?+
Because usefulness isn't the point — verification is. A trivial program isolates the question 'is my toolchain set up correctly?' from 'is my logic correct?'. If even one line of output fails, you know the problem is in your environment, not your code, which makes everything you build afterward easier to debug.
Is 'Hello, World' still relevant with modern tooling?+
Yes, arguably more so. Modern stacks have more moving parts — package managers, virtual environments, containers, build tools — so there are more ways for setup to silently break. A minimal program that just prints or returns a string is still the fastest way to confirm the whole chain works before you invest time in real features.

Related reading

See all Dev Knowledge articles →

Get the best tools, weekly

One email every Friday. No spam, unsubscribe anytime.