Want to keep learning?

This content is taken from the Raspberry Pi Foundation & National Centre for Computing Education's online course, Programming Pedagogy in Secondary Schools: Inspiring Computing Teaching. Join the course to learn more.

Skip to 0 minutes and 2 seconds How can you use PRIMM to teach programming in your classroom? I’m joined by the Chief Learning Officer for the Raspberry Pi Foundation, Dr. Sue Sentance. Thank you for joining me. Thank you. So first of all, what is PRIMM? PRIMM is an approach that you can use in the classroom for teaching programming. It stands for predict, run, investigate, modify, and make. So predict means, if I look at a piece of code, can I work out what I think it might do when it runs? So that’s an activity in the classroom. The run means running it and to seeing whether it does what you thought– you predicted.

Skip to 0 minutes and 40 seconds You predicted and then trying to work out why it didn’t do it if it didn’t do what you predicted. Investigate is getting into the nitty gritty of the code and trying to understand. So that’s program comprehension. Modify is now you understand how it works, see if you can extend it and make changes to add different functionality. And make is the creative part. So that’s when you can make something new using those skills. So PRIMM is this sort of sequence of those activities. And the idea of putting them all together is so that teachers have sort of a toolkit of things that they can do in the classroom.

Skip to 1 minute and 17 seconds They don’t necessarily have to do all of those things in one lesson, but it gives us some guidance. So what made you want to develop PRIMM as an approach to learning programming? I don’t think we set out and went, oh, we’re going to develop a method of teaching programming. I mean, I started as a programr, and then I went into teaching programming. So I’ve got quite a lot of teaching programming experience myself. Then I trained teachers in teaching programming. And at the same time, I was doing a lot of research around tracing, and worked examples, and use-modify-create in these approaches.

Skip to 1 minute and 49 seconds And it seemed to me that the research was up here and all written in these papers that nobody could understand. And teachers’ practise was down here. And teachers were learning about how to program, but not really how to teach it. And through my work with my trainee teachers, we were sort of working out how you bring the theory into practise. And at the time, I was teaching a master’s module at Kings around the theory, the practise of teaching programming and teaching computing. And really, that’s how PRIMM came about, through that thinking process and trying out different things. You mentioned, use modify, create when you were explaining there. Can you let us know how PRIMM develops that model– the use-modify-create model.

Skip to 2 minutes and 34 seconds Yes, the use-modify-create has been around since 2001. And the idea of that is that you use something– use a piece of software– and then modify and create. Now, the modify and make in PRIMM is the same. But the use is quite different from the PRIMM– the PRI. Use is quite exploratory. And it’s not very specific. PRIM– predict, run, and investigate actually is quite detailed. It gives you some specific things to do. And it draws on other research so the predict, run, and investigate draws on research from the block model, and from tracing, and from abstraction, other areas of the research. But the thing they have in common is the idea of using something and then modifying it.

Skip to 3 minutes and 27 seconds It means you move from– it’s not my program. You know, it’s something that my teacher developed– to, it’s my program. And both PRIMM and use-modify-create have that as a thing. And the reason that’s important– and that also relates to some of the education theory– is around, if something is out there and I don’t understand it, or I can’t do it, or it doesn’t work, it doesn’t matter because I don’t have complete responsibility or ownership of it. If my teacher’s written a program that doesn’t work, I don’t have to feel so bad about it.

Skip to 4 minutes and 4 seconds So then gradually, the responsibility for that program becomes yours as you then feel you understand it a bit better, rather than having to write a few lines of code, to understand what it means, and it’s all your fault when they’ve gone wrong. That’s the commonality between the two approaches. And is there a particular age range that this approach works best with? Well, I’m a secondary teacher by background. So I was thinking of it in terms of secondary when learning text-based programming, particularly moving from scratch into Python, or a block-base to a text-based language. But actually, I’ve been really surprised, because a lot of the primary teachers that I know are really interested in it.

Skip to 4 minutes and 44 seconds And Phil Bagge and Jane Waite have advocated it, which is been great. I’m not a primary expert at all. And I’ve also heard of people in higher education using it. And the University of Cambridge are trialling PRIMM in their Java course first year, starting this month. So I think the age range is wider than you might think. I’ve heard people say they can teach other things using PRIMM, not just programming– like statistics. So we’re playing around with teaching statistics using PRIMM as well. So who knows? Interesting. So can you tell us why it is so important for learners to verbalise their thoughts before writing them down? I think there’s two things about verbalising. It’s partly the verbalising.

Skip to 5 minutes and 34 seconds It’s partly saying things out loud. Because in order for you to explain something or say something out loud, you have to do a little bit of thinking about it. And you have to sort of formulate your ideas a little bit. Having to go from what’s this sort of muddle in your head to be able to say things much more clearly– that process of saying it to the rubber duck. However, really with PRIMM, we want people to talk to each other. Because actually, it’s the exchange of ideas. And it’s the sort of “two heads are better than one” thing. As well as using language, you’re actually communicating. So you’re not just saying something.

Skip to 6 minutes and 14 seconds You’re saying it, and getting a response, and sharing the exploration of the program. So the investigate stage uses the block model for task design. Could you tell us a little bit more about this? So the block model is wonderful. Not everybody knows this– in fact, probably have never even heard of it. But the block model is a piece of research that was done about 10 years ago that really talks about how you might understand programming. It’s about comprehension of programs divided into a grid of 12 cells. And along one line goes the structure of my program, what happens when it runs, and what it’s for.

Skip to 6 minutes and 58 seconds And along the other axis goes a tiny little bit of code, a slightly bigger block of code, relationship between bits of code, and then the whole thing. So if you do that four-by-three, you get 12 things–

Skip to 7 minutes and 16 seconds in a way, almost like 12 skills that you need in order to be able to be good at program comprehension. And there is a lot more that can be done with the block model. But someone described it as a hole-y quilt– as in, got holes in it. And so, in that a lot of students’ understanding of a program that’s got holes in it and that they only understand some of those bits. They can’t ask the questions around all of those areas. What’s the function of this tiny little block of code? They might tell you the function of the whole thing, for example.

Skip to 7 minutes and 52 seconds So what we’re trying to think of in the Investigate phase is thinking about, can you ask questions that are in all of these areas? Because often, we’re only asking the same sort of questions. So part of PRIMM is not just the structure of it, but it’s actually the questions you ask. And getting good questions means that you want to ask a range of questions that cover those sort of skills that you can see in those cells block model.

What is PRIMM?

PRIMM stands for Predict-Run-Investigate-Modify-Make. It builds on the Use-Modify-Create model.

PRIMM was introduced by Sue Sentance in 2017 [1] and pulls together known effective teaching practices into one, structured framework. Sentance et al. [2] published an article about the effectiveness of this approach in April 2019. The study tested the PRIMM approach in 13 schools with 493 learners, and found that those learners following the PRIMM approach performed better than the control group. Several teachers in the study noted that the approach enabled ease of differentiation. To read more about PRIMM look at these PRIMM materials and activity sheets.

Here we will look at the PRIMM stages in more detail:


Learners are presented with a program to read and try to predict what it will do. Learners should verbalise and discuss their predictions before writing things down. The “predict” stage works well as a paired or small group activity. This helps to build the necessary vocabulary through dialogue. Learners should be focused on what will happen when the code is run.

The programming example that you provide for your learners should include familiar programming constructs and introduce only one or two new concepts.


This is where learners get to test their predictions from the previous stage. It is important to remember that the educator is an essential element in the success of the PRIMM approach. The educator can provide structure at this stage and use discussion to help the learners verbalise the function of the code and see whether it matched their predictions.


The “investigate” stage uses questioning techniques that are linked to work produced by Schulte in the block model. The focus of the model is code comprehension.

The model uses four levels of understanding:

  • Atomic: individual lines of code or even sections of those lines of code
  • Block: groups of adjacent lines of code that link very closely together
  • Relational: lines of code that are related but are not next to each other
  • Macro: the entire program or larger subprograms depending on the size of the project

The educator should prepare activities or questions for the learners to complete while investigating the code. The questions should be designed to cover all aspects of the block model. Example activity types are:

  • Tracing, where you look at variables in a piece of code and trace their values throughout the running of the program. Tracing allows a learner to develop their logic skills. Learners should be able to confidently trace code through sequences, selection statements, and loops.

  • Explaining, which can happen in pairs verbally to help support vocabulary development. Learners should be able to explain at each level of understanding in the block model, starting at the atomic level.

  • Annotating, where learners comment on each line or block of code by stating what it does.

  • Debugging, which ensures that the code works when the learner is investigating it. You might intentionally add a minor logic error or a piece of code that is not needed. Learners are then given activities to spot where those errors might be happening.

By using the block model to develop activities and questions, you can try to pinpoint where a learners’ misconceptions are. If a learner has a gap in their understanding, they are most likely missing a level of understanding from the block model. You can then target questions and activities at those specific areas to help support your learners.


The “modify” stage in PRIMM is very similar to the modify stage in Use-Modify-Create. Learners complete a variety of modifications to the code that they have previously investigated, with an increasing level of challenge. The scaffolding is carefully removed as learners become more comfortable with the new concepts that they have learnt.


For the “make” stage, learners are given a new problem to solve that uses the same structure and concepts that have been learnt. This gives them time to apply new learning in a familiar setting. The “make” stage should involve algorithm design in which learners use their computational thinking skills to break the problem down into sub-goals and produce an algorithm for the solution.


  • Have you tried using PRIMM in your lessons before? If so, what successes and challenges did you experience?
  • How often do you ask your learners to trace code in your programming lessons? Is this something that you might use more after reading this step?

Further reading

[1] Sentance, S. & Waite, J. (2017) PRIMM: Exploring pedagogical approaches for teaching text-based programming in school, In: Barendsen, E. and Hubwieser, P. (eds.) Proceedings of the 12th Workshop on Primary and Secondary Computing Education, 8–10 November 2017, Nijmegen, The Netherlands. New York, ACM. pp. 113–114.

[2] Sentance, S., Waite, J. & Kallia, M. (2019) Teaching computer programming with PRIMM: a sociocultural perspective. Computer Science Education. 29 (2–3), 136–176. Available from: doi.org/10.1080/08993408.2019.1608781

Share this video:

This video is from the free online course:

Programming Pedagogy in Secondary Schools: Inspiring Computing Teaching

Raspberry Pi Foundation

Get a taste of this course

Find out what this course is like by previewing some of the course steps before you join: