More about PRIMM

I discovered PRIMM earlier this year while completing my study towards the New Zealand Certificate in Education Technology (Advanced Practitioner) (Level 6) through The Open Polytechnic of New Zealand (a subsidiary of Te Pūkenga). It wasn't something covered in the qualification, but it did become an important part of my proposal for the final two assessments.

The last course of the qualification was titled "Leadership using Educational Technologies", and its assessment was centred on providing evidence of leadership techniques being used to implement educational technologies within an organisation. I choose to discuss the implementation CodePen.io in assessment one and Replit.com in assessment two. For both assessments, I described how the technologies could be used to support delivery using the PRIMM model.

So what is PRIMM?

Primmportal.com, which is the official home of PRIMM describes it as "an approach to planning programming lessons and activities…".

PRIMM is also an acronym for the following stages that a learner progresses through:

  • Predict: Learners discuss a program and predict what it might do, drawing or writing out what they think will be the output. At this level, the focus is on the function of the code.
  • Run: Learners run the program so that they can test their predictions and discuss them in class.
  • Investigate: The teacher provides a range of activities to explore the structure of the code; this involves activities such as tracing, explaining, annotating, and debugging. This is a great opportunity for learners to share their understanding and learn from each other's experiences.
  • Modify: Learners edit the program to change its functionality via a sequence of increasingly challenging exercises; the transfer of ownership moves from the code being ‘not mine’ to ‘partly mine’ as learners gain confidence by extending the function of the code.
  • Make: Learners design a new program that uses the same structures but solves a new problem (e.g. has a new function).
The I in PRIMM — Hello World
Sue Sentance explores how the Block Model — a framework for program comprehension — can create opportunities for students to investigate code fully.

PRIMM was introduced by Sue Sentance in 2017 and is supported by a research trial involving around 500 students. The study indicated that the group of 493 students taught using the PRIMM approach performed significantly better than a comparison group of 180 students. Teachers also discussed gaining more confidence or insight into their own teaching methods.

While the PRIMM trial was conducted in a face-to-face, synchronous environment with learners aged 12–14. There are a number of interesting tools and technologies available to help facilitate the approach in an asynchronous environment.

How does it work?

"…being able to type out perfect syntax doesn't necessarily mean you know why or how something is working."

Let's start by looking at a more traditional approach. You've probably found tutorials online or seen courses where the instruction starts with a "Hello World" example.

here's one for C++:

#include <iostream.h>

int main(void)
{
  cout << "Hello World" << endl;
  return 0;
}

C++ Hello Word example

and a much simpler one for JavaScript:

alert('Hello World');

JavaScript Hello Word example

The instruction likely focused on the Syntax and required you to either type or copy the text, save and run it to see the result. There's a good chance that you made a couple of typos and encountered some errors too. The issue with this is that the program doesn't really do anything. and it's difficult to connect such a simple, seemingly meaningless piece of code to what you imagine should be possible.

Now the syntax is definitely important, but being able to type out perfect syntax doesn't necessarily mean you know why or how something is working.

The PRIMM model aims to expose learners to working, meaningful code first and encourages them to explore and experiment with it to build their understanding. Writing their own code comes later.

Let's take a look at an example in Python – This project is called Band name generator:

Band name generator

this project was created by Appbrewery and is included in this Udemy course.

100 Days of Code: The Complete Python Pro Bootcamp for 2022
Master Python by building 100 projects in 100 days. Learn data science, automation, build websites, games and apps!

This is also a good opportunity to introduce Replit.com Repls. A Repl is the term used to describe a project running in the Replit.com IDE. They are collaborative, shareable, and as you can see above, embeddable – which makes them perfect for inclusion inline in an LMS.

Predict

The first stage of the PRIMM model asks learners to predict what the program will do – before running it. Consider each line; what do you think the symbols mean? what does print mean? what will input do? what does + do?

Run

Now run the program. Pressing the green play button at the top of the example above will run the program, and its input and output will be displayed in the console section of the frame.

Did it do what you expected? Were there any surprises?

The key point here is that the code works! The learner isn't held back by a couple of errors that are made while typing, errors they are unlikely to understand, and that could reinforce a perception that "coding is hard and I'm not good at it"

Investigate

The example above is pretty simple and doesn't provide a lot of opportunities to investigate. however, at this stage, learners should be provided with activities like tracing the flow of the programme, perhaps creating a flow chart, or annotating/commenting on the code.

The Investigate stage uses questioning techniques from the Block Model, focusing on code comprehension.

The model uses four levels of understanding:

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

Design questions to cover all aspects of the Block Model. For example:

  • Tracing: looking at variables in a piece of code and tracing their values throughout a running program. This allows a learner to develop their logic skills.
  • Explaining: Learners should be able to explain at each level of understanding in the Block Model, starting at the atomic level.
  • Annotating: Commenting on each line or block of code, stating what it does.
  • Debugging: Ensures that the code works. Consider intentionally adding minor logic errors or a redundant piece of code. Ask learners to spot where those errors might be happening.

By using the Block Model to develop activities and questions, you can try to pinpoint misconceptions. gaps in their understanding, they are most likely missing a level of understanding from the Block Model. Targeting questions and activities in specific areas will help support learners.

Find out more about the Block Model by reading the Block Model Quick Read.

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.

Modify

This is where things start to get a bit more interesting. What happens if you swap street and pet around on the last line of the program? what happens if you remove /n from the end of lines two and three?

It's also a good opportunity to try things that result in errors. What happens if you remove a closing bracket from a line? what happens if you remove one of the quote marks? What happens if you put a space at the beginning of line three?
scroll back up and have a go. The Repl is interactive.

Create

In the last stage of the PRIMM model, learners use their new knowledge to create something similar. Can you create a superhero name generator? or names for a brewery? can you use more than two inputs?

Having gone through the previous stages, learners are more likely to understand why the example works and are more likely to be able to identify errors and mistakes as they occur.

What else can you use PRIMM for?

"The PRIMM model was specifically created and trialled for the delivery of programming/coding education, but I think the process can be applied to other types of technical instruction."

Another obvious application of the PRIMM model is the delivery of web design content. Learning web design often revolves around three main technologies, HTML, CSS, and JavaScript. Very often discussed and delivered separately.

You may have experience learning HTML and being presented with the ubiquitous boilerplate code block.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>HTML 5 Boilerplate</title>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
	<script src="index.js"></script>
  </body>
</html>

HTML boilerplate from freecodecamp.org

I'm not suggesting that boilerplate code isn't important, but almost none of it actually helps a learner understand how to make something appear in a web page. take a look at the example below.

See the Pen boilerplate by Chester Whitwell (@chesterwhitwell) on CodePen.

All that code and nothing gets displayed.

It's worth noting that Codepens are designed only to require the HTML that fits between the <body> tags. It's not necessary or recommended to include any boilerplate code.

A more PRIMM approach would have learners interacting with a working piece of code and building their understanding through investigation and modification.

take a look at this example.

See the Pen Real Time Form Validation Boilerplate by Ire Aderinokun (@ire) on CodePen.

It's probably a good time to mention that the example above is presented using codepen.io. Pens, like Repls, are shareable and embeddable. They are also interactive, so you can switch between the HTML, CSS and JavaScript in the top right corner and edit the content. The Results button will toggle the output on and off.

There's definitely more going on here, and the CSS might be a little overwhelming at first, but a registration form is likely to be something learners will be familiar with and have likely interacted with or at least seen before.

It's also worth remembering that it's not necessary to understand every element of the code all at once. PRIMM stages can be applied to small pieces.

for example:

Predict – What do you think <form class="registration"> does?

what do you think this does?

.registration {
	background-color: #fff;
	max-width: 600px;
	margin: 0 auto;
	padding-bottom: 20px;
	box-shadow: 1px 1px 5px 0px rgba(0,0,0,0.3);
	border-bottom: 5px solid #ffdb3a;
}

Modify – what happens if you change max-width to 800px?

Make – After a few iterations of the first four stages, a learner may be able to make a contact form or a login form.


The PRIMM model was specifically created and trialled for the delivery of programming/coding education, but I think the process can be applied to other types of technical instruction.

Many of the design-based courses I've worked on often include instruction for the use of Adobe software, including Photoshop, Illustrator and Indesign. Often instruction starts in a blank document and steps through the process of creating something – a brochure, image composition, poster, or logo, for example.

Instead, starting with a completed document/project, investigating specific elements, and modifying them before making new elements and eventually, new documents would be an approach that is closely aligned to the PRIMM model.

Conclusion

The PRIMM model is a great way to introduce learners to coding and other technical skills. I believe it is a process that can be applied to many different types of instruction, not just coding, and has been shown to be an effective way to engage learners and help them build understanding. I also think that in an asynchronous delivery environment, PRIMM can be a powerful tool for building an understanding of complex processes. It is often easier to understand the process if you know what the end result is meant to be.

Photo by Scott Graham / Unsplash