Chapter 42: The PRIMM-AI+ Framework
"The PRIMM approach recognises that starting with existing code and being able to explain what it does gives novice programmers the confidence to write their own programs. PRIMM begins from reading and explaining code, not from writing it cold." -- Sentance, Waite, and Kallia (2019)
Why This Chapter Exists
James stares at fifty lines of AI-generated Python. Every line works. He understands none of it. His mentor Emma points at line twelve. "What does that line do?" James cannot answer. He has working code and zero knowledge.
AI can write code in seconds. But if you cannot read what it produces, you cannot verify it, debug it, or adapt it. You are not programming. You are copying.
This chapter introduces PRIMM-AI+: the method you will use in every programming chapter from here on. It stands for Predict, Run, Investigate, Modify, Make, with clear rules for when you can use AI and when you cannot. Built on research-tested methods (493 students, 13 schools), PRIMM-AI+ teaches you to read and understand code before you write it. The rhythm is always the same: see a program, predict what it does, run it, investigate how it works, modify it, then build something new. The concepts change. The method never does.
The Five Stages
| Stage | What You Do | What AI Does |
|---|---|---|
| Predict | Read the code, write your prediction | Generates code, but must not explain it |
| Run | Compare your prediction to the actual output | Executes the program, shows raw output |
| Investigate | Write your own explanation, then ask questions | Answers your questions after your attempt |
| Modify | Change the code yourself before asking for help | Provides hints, not solutions |
| Make | Write a specification first, then build | Reviews your work, but does not write it |
You understand before you change, and you change before you create.
Learning Outcomes
By the end of this chapter, you will be able to:
- Name the five stages of PRIMM and explain why they start with reading, not writing
- Walk through a complete PRIMM-AI+ lesson cycle with a real Python program
- State the five rules for working with AI as a learning partner
- Identify five kinds of bugs and use the taxonomy to narrow down problems
- Solve a Parsons problem by reasoning about data flow and execution order
- Describe the five-step pattern every programming chapter follows
Lessons
| # | Lesson | Duration | Key Focus |
|---|---|---|---|
| 1 | The PRIMM Framework | 20 min | The five stages demonstrated with real Python code, the research basis, and why comprehension matters most in the AI era |
| 2 | PRIMM-AI+: AI as Your Learning Partner | 15 min | Three rules for working with AI, a complete walkthrough, and five habits to build as a programmer |
| 3 | Completing the Toolkit | 15 min | Five kinds of bugs, Parsons problems, and the five-step pattern every chapter follows |
About the Code in This Chapter
This chapter contains Python code examples. You are not expected to understand every line yet. The code is here to show you what the PRIMM process looks like in action, so that when you encounter your first Python lesson in Chapter 45, the method is already familiar. Focus on the process (predict, run, investigate), not the syntax.
What Comes Next
This chapter teaches you how you will learn. The next chapter (Chapter 43: Ten Axioms) teaches what professional practice looks like. After this chapter, you will never open a programming lesson wondering what to do first. The method handles that. You focus on the code.