Ever wondered why every programmer starts by printing "Hello, world"? :D
Nobody decided it in a meeting. it stuck, the way good habits do.
Where it came from
The earliest known "hello, world" program was written by Brian Kernighan at Bell Labs in 1972, in a tutorial for a language called B. It became famous a few years later, when The C Programming Language opened with it. Generations of programmers learned from that book, so they all started the same way.
Why it works
It's the smallest program that proves everything is wired up:
- Your editor saved the file.
- The compiler or interpreter ran.
- The computer did what you asked.
- You can see the result.
If "Hello, world" prints, your setup works. If it doesn't, you've found a problem before writing anything that matters. That makes it a test as much as a greeting.
Here it is in a few languages
System.out.println("Hello, world");fmt.Println("Hello, world")print("Hello, world")Same idea in all three. Different languages, same first step.
Why I'm starting here
This blog is a new program, so it begins the same way: does it work? Yes. Everything is wired up, and more posts will follow.