What is it?
PRIMM is a teaching methodology that stands for:
Predict - give students a chunk of code that does something and get them to predict what it will do
Run - students then run the code and see if their predictions are correct.
Investigate - students then spend some time investigating the code in depth. This might mean tracing the code, debugging it, annotating it or making notes.
Modify - students then take this code and modify it to do something different
Make - finally, students take the code and make something completely different
Why would you use it?
PRIMM is excellent if are trying to get students to understand code that at first glance isn't obvious in what it does. For example, it might be a programming construct like a while or for loop or it might be a specific algorithm or even an algorithm that has errors in it.
Why is it a good thing?
There are many ways of teaching students how to read and understand code but PRIMM provides a good framework that focuses on students reading and understanding the code before they start running and playing with it. This allows students to base their practice on a firm understanding rather than writing coded solutions they don't really understand.
How does it work?
Predict what the following code will do:
someText = "Hello there"
letterToFind = "l"
count = 0
for i = 0 to someText.Length - 1
if (someText[i] == letterToFind)
count = count + 1
end if
next i
print "There are " + count + " instances of " + letterToFind + " in " +
someText
Now run it - this is pseudocode but you can rewrite it in Python / C# / Java etc. Was your prediction correct.
Investigate
Next, can you step through it line by line, explaining in English what each line does?
Can you debug it using a debugger, stepping through each line, predicting what the value of each variable will be at that point and using the debugger to see if you are correct?
Modify
Can you change the code so that it counts the number of Es?
Can you change the code so that is iterates through the string backwards?
Can you change the code so that it totals all of the letters?
The last is deliberately vague. It could be that students count the number of letters in the string against all letters of the alphabet or just the letters that are in that particular string.
Make
Finally, can students go off and make something using the skills they have learned? Can they write a program that counts vowels and consonants? Can they make a program that does a statistical analysis of a piece of text that has been encrypted using Caesar Cipher?
What does this look like in the classroom?
Once you understand the framework very little prep is required. Similarly, this can be done as a plugged or unplugged exercise. Simply select a piece of code relevant to the learning objectives and Predict and Run are pretty much done for you. Modify needs a little thought but getting students to change variable values is an obvious first step with extension questions on how the code or construct could be applied to a similar but different scenario.
What do the students think?
I did a survey. The results were as follows:
The majority of respondents enjoyed the activity and felt it was beneficial. There was a slight negativity towards the ability to modify and make but given that my journey is about getting all students to learn how to code (I am not there yet) this is understandable.
Pair programming
In addition to the PRIMM task above, I also had students work in pairs. This generally went down well especially as I explained how this would benefit them in terms of future skills but also in their coding. It was generally positive. More to follow on pair programming.
Comments