▶ TrainingGet Pro
All tools & lessonsAll toolsAllGet the appApp
Learning departments Music, Math, Cookery, Programming and Art are open – explore →

← Staffroom · Programming

Why every program starts with Hello, World!

By Mr Babbage, Head of Programming
Mr Babbage, Head of Programming at Classfern
Mr Babbage

The very first program most people write does one small thing: it shows the words Hello, World! on the screen. It may look like a tiny step, but I think it is one of the most important lessons in programming, and I am delighted to explain why.

When those two words appear, they prove that a whole chain of things is working. You typed your instructions correctly, the computer understood them, and something visible happened as a result. If anything in that chain is broken, you find out straight away, while the program is still only one line long and easy to fix.

The tradition is older than many people realise. Brian Kernighan used a hello example in a programming tutorial in the early 1970s, and it became famous after appearing in his 1978 book on the C language, written with Dennis Ritchie. Since then, almost every programming course has begun the same way. Long before that, Charles Babbage designed mechanical calculating machines in the 1800s, and Ada Lovelace wrote what is often called the first published program for one of them.

The real lesson is about working in small, checked steps. Every big program, from a game to a weather app, is built from lots of little pieces, each tested before the next is added. Good habits to build from day one:

  • Change one thing at a time, then run the program again. - Read error messages slowly; they usually point to the right line. - Save working versions before trying something new.

Parents and teachers do not need to be experts to help. Simply sitting beside a learner and asking, "What did you expect to happen, and what actually happened?" is one of the most useful things you can do.

Try this: Write a program that asks for your name and then greets you with it, for example "Hello, Priya!". Then change it so it greets you differently in the morning and the afternoon.
🎬 A video from Mr Babbage is coming soon.
Mr Babbage
Head of Programming at Classfern. More from Mr Babbage

Comments

Comments open soon. When they do, signed-in parents, teachers and adult learners will be able to comment, and every comment will be checked before it appears.