How to Teach Coding with Rubik’s Cubes

Exploring the PRIMM model in Computer Science

Computer Science is often seen as a hard subject to learn. It is also often assumed that someone has to be born to program, or code, in a similar way to being born a gifted musical composer. It requires a certain personality (we call them geeks), and therefore is beyond the comprehension of most common folk! Some also argue that computing is a “boys” subject and that girls are not interested in learning how to code. However, that is not the belief of educational experts, which is why Computer Science was introduced by OCR as a GCSE in 2012 as an alternative to Information Computer Technology (ICT)[1]. 

This article is a re-blog posted by David Sherratt with kind permission. The original post can be found by clicking here.

Compared to other school topics, pedagogical research into coding is still a new and developing area. Nonetheless, lots of attention is now being given on how to teach programming; recently with a focus on teaching younger children to learn the basics of coding. Children require more scaffolding in order for them to progress, compared to adults who have accumulated a foundation of experiences and knowledge to rely on, and this makes best practice, in terms of teaching and learning, central to Computer Science [3].

Furthermore, measuring progress and understanding in regards to coding is not so simple. A working computer program does not equate to understanding, as lines of code can be available online and be copied and pasted without any knowledge of what the code precisely does. This is like trying to learn about the engine of a car, but only understanding how the pedals make the car start and stop.


One solution to teaching children to code is called PRIMM. Based on research into the learning of coding [2], PRIMM serves as a structure for activities, providing scaffolding and support for pupils’ understanding of computing more generally. PRIMM, of course, is an acronym, where each letter represents a step in the model. These are:

  • Predict – Pupils are given some code, are asked to analyse it and predict what it does.
  • Run – The code is run and pupils observe what the code does, comparing it to their predictions.
  • Investigate – The code is broken down, and is executed on paper line by line, as pupils observe the effects and results obtained.
  • Modify – Now the ownership of the code starts becoming the pupils. Pupils test the theoretical understanding acquired to change the results of some given code, gaining a practical comprehension. 
  • Make – Now the pupil takes complete ownership of the code. Using the concepts they now understand and have adapted, pupils make a new program that solves a different problem. 
A flow chart representing PRIMM

The model of PRIMM is linear and simple, but relates to a model of generating and accumulating knowledge. In regards to design, the initial model was created by Charles Owen and published in 1998. It has had over 300 academic citations since [4]. Owen’s model highlights that the learning process has different phases that, although not always completed in the same order, always begin with some form of analysis and end with experimentation and invention. This observation is at the heart of the PRIMM model. 

Importantly, Owen’s model discusses two realms that both contribute to knowledge accumulation: the realm of theory and the realm of practice. Both realms in the model make use of using pre-existing knowledge to build further knowledge. In the realm of theory, proposals are tested and are verified or refuted, as learners gain insight and expand their knowledge. In the realm of practice, products or creations are made with the use of this knowledge. Lastly, the value of the product is assessed, and the creator gains further insight and more knowledge from this. 

PRIMM and learning in the classroom

The PRIMM model has been tried and tested with success. Sentence et al. report teachers using PRIMM found it brought structure and routine, and saw the potential for it to enable differentiation [5, 6]. For instance, teachers noted that PRIMM enables a structured routine for pupils, providing them with familiarity with the process which allows for the development of self-confidence and resilience. Also, many teachers described PRIMM as a tool that allows pupils to think more creatively, providing wider access to a range of different methods to differentiation. The studies conducted serve as evidence to this, with teachers revealing how their pupils talked and collaborated with each other to further develop their understanding of Computer Science concepts and programming techniques.

A proposal on how the PRIMM model could be simulated by Owen’s model  

This method of teaching and learning feels very natural. Just like when a child is given a toy, they will make guesses and play with the toy until they can figure out what it does (essentially acquiring knowledge). After, they may test the toy by playing with it in different ways and situations (gaining insight) until finally the child becomes bored with the toy and needs to come up with their own ideas to make the toy seem fun again (mastery).

Rubik’s Cubes and The Reach Free School

A perfect example of using PRIMM is solving a Rubik’s cube. Here at The Reach Free School, we have developed a workbook based on PRIMM that teaches pupils an algorithm for solving the Rubik’s cube puzzle. The algorithm is broken down into sections, and each section follows the PRIMM method to achieve the milestones required to solve the puzzle. Therefore, we are doing more than just teaching an algorithm, we are also developing critical thinking, analytical skills and computational skills.

Booklets used at TRFS

We believe that this pedagogical approach to programming/coding is natural and playful and can be adapted to other subjects outside of computing. Owen’s paper provides a model that we believe can simulate PRIMM, suggesting that PRIMM could also serve as an effective tool outside of computing.


[1] Dallaway, E., 2020. GCSE Reform: A New Dawn Of Computer Science. Crest. Link Last Accessed 28/12/2020.

[2] Lee, I., Martin, F., Denner, J., Coulter, B., Allan, W., Erickson, J., Malyn-Smith, J. and Werner, L., 2011. Computational thinking for youth in practice. Acm Inroads2(1), pp.32-37.

[3] Lieb S. (1999) Principles of Adult Learning [On-line] Available: Accessed 03/01/2021.

[4] Owen C. L.,“Design Research: Building the Knowledge Base,” Design Studies, 19/1 (January 1998): 9-20; Charles L. Owen, “Understanding Design Research:Toward an Achievement of Balance,” Journal of the Japanese Society for the Science of Design (Special Issue), 5/2 (1997): 36-45.

[5] Sentance, S., Waite, J. and Kallia, M. (2019). Teachers’ experiences of using PRIMM  to teach programming in school The 50th ACM Technical Symposium on Computing Science Education: SIGCSE 2019, Minnesota.

[6] Sentance, S., Waite, J., & Kallia, M. (2019). Teaching computer programming with PRIMM: a sociocultural perspectiveComputer Science Education29(2-3), 136-176.

You need to or Register to bookmark/favorite this content.

About UKEdChat Editorial 3188 Articles
The Editorial Account of UKEdChat, managed by editor-in-chief Colin Hill, with support from Martin Burrett from the UKEd Magazine. Pedagogy, Resources, Community.

Be the first to comment

Leave a Reply

Your email address will not be published.