Sue Sentance: Teaching the world to program

A figure sprinting: silhouette binary
Image by Gerd Altmann from Pixabay (edited)

How do you learn to program? How do you best teach programming. When the English school curriculum changed, requiring even primary school students to learn programming, suddenly this became an important question for school teachers who had previously not had to even think about it. Teaching is about much more than knowing the subject, or even knowing how to teach. It also needs knowledge and skill in how to teach each specific subject. Many teachers had to learn these new skills often with no background at all. Luckily, Sue Sentance came to the rescue with PRIMM, a simple framework for how to teach programming suitable for schools. She was awarded the BCS Lovelace prize for the work.

If you were a novice wanting to develop maker skills, whether building electronics, making lego, doing origami or knitting, you might start by following instructions created by someone else for a creation of theirs. Many assumed that was a sensible way to teach programming too, but it isn’t. This approach, sometimes called “copy code” where a teacher provides a program, and students type it in, is a very poor way to learn to program. But if you can’t do the obvious, what do you do?

Sue came up with PRIMM as a way to help teachers. It stands for Predict, Run, Investigate, Modify and Make, giving a series of steps a programming lesson should follow.

The teacher still provides programs, but instead of typing the code in line by line the students first read it and try to predict what it does. This follows the way people learn to write – they first read (lots!)

Having made a prediction, the students run the program. (They don’t type it in at all, as there is little point in doing that, but are given the file ready to run), They now act like a scientist and see if their prediction is correct. Perhaps they predict the program prints 

Hello World

all on one line. By running the program they find out if they were right or not. If they were then it confirms their understanding. If it doesn’t then this suggests there was something more to understand. If the program instead printed

Hello
World

over two lines, then there is something to work out about what makes a program move to another line. The class discuss the results and compare their predictions with the results. Can they explain why it behaved the way it did?

Next they investigate the program in more depth. The teacher can set a variety of exercises to do this. One very powerful way is stepping through program fragments line by line (doing what in industry is called a code walkthrough and is also called dry running or tracing the code). 

Based on the deeper understanding gained by this they then attempt to modify the original program to do something very slightly different – for example, to print 

Hello, Paul. 
How are you?

This is more exprementation to check and expand their understanding. By making deliberate changes with specific results in mind, they can now purposefully make sure they really do understand a programming construct. As before, if the program does something different to expected then the reason can be explored and that is used to correct what they thought.

If they have fully understood the code then this should by now be fairly easy.

Finally they make a program of their own. Based on the understanding gained they create a new specific  program that uses the new constructs (like how to print a message, get input or make decisions) that they now understand. This program should solve a different problem. For example if they just played with a program containing an if statement, they might now write a simple quiz program, or simulates a vending machine where items cost different amounts. .

Part of the reason that PRIMM has been successful is that it is not only a good way to learnt to program but it gives a clear structure to lessons that can be repeated with each construct to be covered and so makes a natural framework for planning lessons around.

Sue originally developed PRIMM with local schools she was working with in mind, but it works so well, solving a specific problem teachers had everywhere, that it is now used worldwide in countries introducing programming in schools.

Women do not figure greatly in the early history of science and maths just because societal restrictions, prejudices and stereotypes meant few were given the chance. Those who were like Maria Cunitz, showed their contributions could be amazing. It just took the right education, opportunities, and a lot of dedication. That applies to modern computer science too, and as the modern computer scientist, Karen Spärck Jones, responsible for the algorithm behind search engines said: “Computing is too important to be left to men.”

– Paul Curzon, Queen Mary University of London

More on …

Magazines …

Front cover of CS4FN issue 29 - Diversity in Computing

Subscribe to be notified whenever we publish a new post to the CS4FN blog.


This page and talk are funded by EPSRC on research agreement EP/W033615/1.

QMUL CS4FN EPSRC logos

Leave a comment