by Paul Curzon, Queen Mary University of London
Superheroes always have an origin myth that describes how they emerged as a hero. Spider-man has his spider bite and death of his uncle; Batman, his fall into a cave full of bats and the murder of his parents; Captain Marvel was exposed to an alien energy source… Why not work out your own origin myth? Everyone should have one. Mine involves a beach, a book of programs, and before that a missionary. It is the backstory of how I became a computer scientist.
My origin myth usually begins with a beach and a book containing some programs, some articles about computers and some computing cartoons. The articles were vaguely interesting, some of the cartoons were funny, but the program listings were fascinating: a whole new language that made computers tick.
At that point computers were way too expensive for me to dream of owning one (and in any case back then there were no mobile computers so unlike now, you certainly couldn’t take one to the beach). All I had was my imagination, but that was enough to get me started.
With nothing else to do on the beach (it was too hot to move), I spent my time lying in the sun reading programs and trying to work out what they did and how they did it. With no computer, all I could do was pretend to be the computer myself, stepping through the listings line by line with paper and pen, writing out the changing numbers stored (their variables) and what they printed. I then moved on to writing some simple game programs myself, like a cricket game. I wrote them in my notebook and again pretended I was the computer to make them work. By the end of the holiday I could program.
I didn’t discover this till decades later but Ada Lovelace, the famous Victorian computer pioneer working with Charles Babbage was in a similar position (well sort of … she was a rich countess, I wasn’t). She also had no computer as Babbage hadn’t managed to fully build his. She had no programming language either to write programs in, or for that matter any actual programs to read. However, she had some algorithms written by Babbage that he intended his machine’s programs would be based on. Just like me, she stepped through the algorithms on paper, working out what they would do (should Babbage ever build his computer), step by step. As a result she learnt about the machine and as it happens also found a mistake in one algorithm. The table she drew of the computer working is often taken as proof she was the ‘first programmer’, though as Ursula Martin, who studied her papers, has pointed out, it is not a program. It is an execution trace or ‘dry run table’. She was actually the first ‘execution tracer’ or ‘dry-runner’.
The importance of dry running code
Dry running programs like this on paper is not just a useful thing for people with no computer, it is also a critical thing for anyone learning to program to do – a way of actively reading programs. You didn’t learn to write English (or any other language) by just writing, you read lots too and the same goes for programming. It turns out that the way I taught myself to program is a really, really powerful way to do so.
Just as importantly dry running programs on paper in this way is also important as a way of checking that programs work as Lovelace found. The modern version is the code walkthrough – a powerful technique that complements testing programs as a way of discovering problems.
While that is the point in time when I learnt to program, there was someone earlier who originally inspired me about computation: a missionary. Sadly I don’t know his name, but he came to our school to talk about his life as a missionary in Papua New Guinea. He told us that one of the problems of travelling there was that communities were isolated from each other and each village spoke its own language. That meant that, as he travelled around, he had a big problem speaking to anyone. Every time he moved on he had a new language to learn or an old one of many to remember. It wasn’t the idea of converting people, or travelling to exotic places that means I remember him more than 40 years later. It was what he showed us next: how he solved the problem. He pulled out a massive pile of cards with holes punched round the edges, labelled with letters. Each had a word written on it in English as well as words in other languages from different places. He spelled out a word a letter at a time (pig was the example he used) by putting a knitting needle through a hole in all the cards next to the letter. Those that fell out were used for the next letter and so on. After three rounds just the card for pig fell out, as if by magic. It wasn’t magic though, it was computation. On the pig card he had cut notches in the holes for p, i and g. As that was the only word with those letters, it was the only card that could fall out for all three letters and then he could read off the translation for the village he was in..
Bitten by a bug
What the missionary was showing us was an edge-notched card system (see the ‘Wood computer’, page 16). I was fascinated and have been ever since about computation, especially when it’s done physically. It was that general fascination for algorithms that led me to want to learn to program.
In my origin story, I was bitten by a bug: the missionary converted me… to computer science.
More on …
Related Magazines …
This article was funded by UKRI, through Professor Ursula Martin’s grant EP/K040251/2 and grant EP/W033615/1.