A framework for teaching coding
By: Steven Floyd
The Ontario Mathematics Curriculum for grades 1-8 includes two specific expectations related to coding, for each grade:
- write and execute code to solve problems and create computational representations of mathematical situations;
- read and alter existing code and describe how changes to the code affect the outcomes.
In this article we’ll discuss the PRIMM framework, which can be leveraged to help students move from reading and altering code in expectation 3.2, to writing their own programming code in expectation 3.1.
PRIMM, first described here, stands for Predict, Run, Investigate, Modify and Make. It is a framework for teaching coding that supports students with reading code prior to being asked to code an application without enough prior knowledge. PRIMM focuses on students having discussions about what a program will do, how and why the program works, and then editing and writing their own programs afterwards.
A key component of the PRIMM framework is that it aligns with Vygotsky’s zones of proximal development, which is the distance between what a learner can do on their own, and what they can do with guidance from an adult or peer. PRIMM aims to move students through the zone of proximal development resulting in a more in-depth understanding of the concepts and/or improved skills.
Predict: Students are provided with code for a program and they predict, together, what the program will do. They do this through conversations and discussions.
Run: After students make predictions about the execution of the program, they run the code and test their prediction.
Investigate: Students take a closer look at the different components of the code, as the teacher suggests activities such as tracing through code and explaining or adding notes to specific parts of the code.
Modify: Students alter the code in order to solve small, related problems or activities provided to them by their teacher.
Make: At this point, students can create their own program that uses many of the components and concepts from the original code that was provided to them, but that serves a new purpose or generates new output or conclusions.
Important: An important aspect of the PRIMM framework is having students discuss the program components with a teacher or peer. This allows for the social construction of knowledge, and highlights the role of language in learning, and the overlooked role of language in learning coding specifically. It can also be very fun and provide the teacher with great insight into the thought processes of their students.
Sentance, S., Waite, J., & Kallia, M. (2019). Teaching computer programming with PRIMM: A sociocultural perspective. Computer Science Education, 29(2-3), 136-176.