PRIMM – A structured approach to teaching programming


Whilst at PyconUK 2018 I listened to the keynote talk from Sue Sentance (Chief Learning Officer at the Raspberry Pi Foundation) about some of the pedagogies used by Computer Science teachers, essentially “what is in their toolkit?” As a very experienced Physics teacher I have been through most of the major government initiatives over the last twenty years and have seen different pedagogical trends come and go and I would say that I have an effective range of strategies for teaching Physics to a whole range of students. It was really interesting to see the variety of approaches highlighted by Sue and I was pleased to see that I do already use many of them in my key stage 3 Computer Science lessons. One approach – PRIMM – caught my attention and this became the main framework for delivering my after school Raspberry Pi Club.



PRIMM is one possible approach to structuring and planning programming lessons and has come about from research at Kings College London into effective ways of teaching programming.

PRIMM stands for:


This approach could be used for a single lesson, over a period of lessons, or to simply identify or highlight to the learners what task we are completing.

Predict – be given a piece of code, printed out or on the screen, and predict what will happen
Run – be given the code and run the code (does it do what you expected?)
Investigate – carry out a task that looks deeper into the code and discuss what is going on
Modify – using the working code students are able to modify the code with more complex challenges
Make – using all the steps above students create their own program from scratch

My after-school Raspberry Pi club has been running almost since day 1 when I bought my first Raspberry Pi six years ago and I have consistently had the following objectives for the club:

My first batch of students are now in year 13 and they stayed in the club for over 4 years. For many of the students attending the club this is their only opportunity to do any programming.

Following the keynote talk and further research I decided that PRIMM would be a good possible way of structuring my after school club and I have been trialling it over the last six months. Any experienced teacher will know that there is no single magic bullet which will transform T&L but this approach definitely has had an impact on the way the club runs.

A casestudy example: Wormy

Students arrive at the session, set up their Raspberry Pi and are told to have a quick play on Wormy (Python games). This was a very wet rainy Friday afternoon and students had to walk to my outside building in a torrential downpour to come to the club. Starting the session with a fun and engaging activity was important.

None of the students attending Pi club have me for CS so will have done no programming in lessons.


I was particularly focusing today on the investigate and modify strands.

Investigate – carry out a task that looks deeper into the code and discuss what is going on
Modify – using the working code students are able to modify the code with more complex challenges


Python games have been developed to be very accessible by students and the code is very well commented.

Before we looked at the code I posed a question to the club “If we wanted to cheat at wormy what three things would you do?”

The main responses were:

– slow it down
– make the worm / blocks bigger
– don’t die when you hit the wall

We then looked at the top of the code and students were asked to identify any lines of code which could be useful in hacking the game.

Students quickly identified a line of code about FPS and a second about cell size and thought that this might be useful. After a discussion of what this might do and looking at where these two lines of code fitted into the wider code for the game students modified them.

Students quickly came across a snag that the cell size must divide into the window size and that not all values of cell size would work. This prompted an interesting discussion while students worked out values that would work.

Once students had modify the FPS and cell size to get an ‘easy game’ we looked at the different approaches and discussed why no groups had the same combination.

We then went back to the code again and students looked for something that would help them not die. With the quality of comments students were able to identify the part of the code that detected a crash. Again different approaches were taken to get round this: some simply commented out the code and others adapted it. A couple of students then identified that just removing the code would have unforeseen consequences which would need to be changed.

This was a fun session and all students achieved the objective of ‘hacking their game’ within the 45 minutes.

The benefits of PRIMM in a club session

For these students this is their only opportunity to programme so they don’t come with a vast wealth of Python (or other language) knowledge.

The predict / run phase is useful as I am able to teach / develop language syntax in a way which seems fun to the students. This is also useful to throw in the odd mistake and see if students will spot it. Having the code saved for the students also avoids having to spend twenty minutes of a short club session typing out code which could then be full of errors.

The investigate phase requires more thought and planning to be effective and in the club context is often through focused questions.

The modify phase brings the most enjoyment in the club and students seems very keen to see what they can do to adapt the sample code. At this phase the code starts to become ‘theirs’ and they take ownership of the new and improved code.

I have not yet mastered the make phase and this is definitely the area that I am working on the most. With many students not coming every single week and with no experiencing of programming in lessons students find it hard to work on code from scratch. I am looking at ways of scaffolding this from the previous steps. There is definitely a sense of panic when students have a blank window to start their own piece of work!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.