Hello world!

Yes – it’s Hello World! Why? Because when you learn to write a first program in a new programming language, it’s a typical thing to do – work out how to output some simple text.

This sounds fine to me for a blog devoted to frivolous wordplay. But is it true? Do all programming courses start with something so trivial? After all CoderDojo is run by the Hello World Foundation. The Raspberry Pi Foundation publish Hello World magazine. There’s even a website devoted to displaying a simple Hello World script in (at last count) almost 600 programming languages. Hello World even gets a mention in Code.org’s video on coding in schools. It’s a shibboleth, an in-joke between programmers.

But, despite the reference in a 1978 text, even back in the 1980s, when learning Pascal at university, the first program I had to write was to investigate how long it would take the sum of a sequence of reciprocals (1 + 1/2 + 1/3 … + 1/n … ) to reach a target value. It’s easy enough to prove that the series is divergent. But, to reach 3 takes only 12 iterations. A total of 6 is achieved after over 200. To get to 10, you need over 10,000 terms in the sequence. Quite a stressful wait if you only have 30 seconds of processor time on a mainframe – probably why they set us such a task. Besides, string handling is a nightmare with some early versions of Pascal. I was going to write “No-one uses Pascal to create adventure games,” but Google tells me I’m wrong.

My first real bit of programming was to write a character generator for a role-playing game back in the late ’70s. But my party piece when I come across a new language is to write a “High-Low” binary search game. It’s  bit more fun than Fizz-Buzz.