Teacher Tips: How to teach programming in your classroom?
JAMES: Hello world, and welcome to the podcast for educators passionate about computing and digital making.
I'm James Robinson, a senior learning manager here at the Raspberry Pi Foundation. And welcome to another of our Teacher Tips episodes, where educators around the world share their experience and advice to help and inspire your CS teaching.
As we've just released a new issue of our free Hello World magazine on the theme of programming, this episode is packed with practical, actionable tips you can use in your classroom to start or level up your programming lessons. We've got four guests on the show today. Over to them to introduce themselves.
DORIAN: My name is Dorian Love. I teach IT and English. I teach students in grade eight and nine. So that's around 13, 14, 15 years old. And I teach at Roedean School in Johannesburg, South Africa.
LAURA: Hi, I'm Laura James. I'm based in the UK. I'm currently a learning manager at the Raspberry Pi Foundation. Before that, for a decade, I worked in secondary schools teaching computer science, both GCSE and A level.
ETHEL: I'm Ethel Tshukudu. Right now, I live in California. I teach at San Jose State University, and I'm in the Department of Computer Science and Science Education, right in the middle of Silicon Valley where I get to teach the next generation of change-makers, who will, you know, be consumed by Silicon Valley companies and have impact globally.
BEN: I'm Ben Schafer. I am a professor of computer science at the University of Northern Iowa in the United States. And I run our CS preparation program for in-service and pre-service teachers who want to be computer science teachers in the K-12 school system.
JAMES: Thank you, Dorian, Laura, Ethel, and Ben for taking the time out to talk to us. And a huge thank you to you, if you replied to one of our social media posts asking for your top tips for teaching programming in the classroom. I'll be sharing a bunch of those during today's episode. Let's start though, with our guests' advice on what to do if you're being asked to teach programming, having not taught it before, or perhaps having not tried programming at all before yourself. Over to Dorian first.
DORIAN: As a boring old fart myself, you know, coming to the end of my teaching career, what advice could I give to young teachers, who are called upon to to teach programming? My first thought is run, run a mile, but that's not very helpful.
I think, embrace it. Don't, don't feel threatened by it, because so much of computer programming is about the real world and solving real-world problems.
The only advice I can really give to teachers who have no background in computer science and are now suddenly having to teach it, is follow whatever passion, you know, takes you at the time. Don't feel you have to you have to learn a particular programming language. There are plenty of platforms out there: the micro:bit platform, MakeCode, generally, and Arcade Game is a nice one. MIT has an app inventor platform. There are quite a few platforms now around Scratch.
Choose one that looks usable in your classroom. And teach yourself as you go along. You know, if you're a few steps ahead of the students, that's actually okay, because there are so many projects and things that students can get involved in on those online platforms, you don't have to be the expert.
I think a big mistake is to believe that students always know more than you. And there's this kind of digital native generation that knows so much more than you do. That's not true. You can learn together with the students. And as long as you make that plain to your class, that, I'm also a beginner, and I'm also learning, I think that can be very motivating for students.
JAMES: Dorian mentioned the myth of the digital native there, and we have a recent episode of the podcast where a panel of educators discuss how the idea of digital natives can overlook complex issues of access, skills, and education. That's well worth going back to and checking out if you haven't before. Dorian also mentioned the benefit of learning to program alongside your students. And Ben, who teaches teachers to teach programming, mentioned the same thing too.
BEN: I actually think that's, in the long run, a benefit, because it puts you in a position where you understand where your students are coming from, because you yourself are a student of that topic. And so you get to experience and see where the struggles are going to be. And you learn that creative problem solving — productive struggle is the word we like to use in our program — productive struggle is where it's all at. And because you're rapidly going through productive struggle yourself, you can take those, those lessons and apply them with your students.
The thing I would suggest is starting small, find a, a tool, maybe it's Scratch, maybe it's micro:bit or Raspberry Pi. Find something gives you a framework for your learning, and then find some materials online that give you some suggestions for things you can do with that environment, and then start playing.
I can't recommend enough the Big Book of Computing Pedagogy, right. There's stuff in here for novice teachers, and there's stuff in here for experienced teachers. If you're relatively new to teaching computer programming, grab the book. It's available as a physical book. It's available as a PDF online. Take a look at PRIMM, take a look at Parsons Problems, both of which are easy, small things that you can start to do in the classroom to sort of level up your teaching. And if you're a more experienced teacher, if you understand those ideas, start to look at the 12 pillars and find ways that you can incorporate something new into your classroom.
JAMES: One challenge you'll face, of course, is that different students are going to have different levels of programming experience and confidence. Here's Laura with advice on further resources that you can use.
LAURA: So at secondary school we get students with a wide range of different backgrounds in programming. We get the very keen coders who've been coding in their bedrooms ever since, you know, they can crawl. We get students who've heard about computer science and think it's the next best thing that they want to do, but don't really know where to start with programming.
Not all computer science teachers in the UK have had a chance necessarily to do a lot of programming themselves. And they often feel like they're on the back foot and trying to catch up with some of their students who are racing ahead.
Do not worry.
There are lots of resources out there. I can recommend Ada Computer Science for a great, a great online reference book for helping you teach computer science. There are many online courses that students and teachers can take to help them get up to speed on various programming languages. You can look at the exam boards, they will always give you examples that you can use to compare against, that should help you and make you feel more confident in delivering those A level lessons.
I highly recommend that you get yourself onto the Facebook groups that are out there, such as the OCR, A level, and GCSE, groups for teachers, also the AQA ones. There are also more generic ones for Key Stage 3 computing teachers, and they're always offering various different resources that are on there.
There are also Reddit groups. There is a really good culture of sharing and support that's out there from, from other computer science educators, and people are always willing to offer up suggestions and schemes of work and resources that you can use to help.
Another good forum is the Computing at School forum, which has lots of free online resources that you can sign up for. And you can just ask questions. And lots of people will be very helpful and reply.
So don't suffer in silence. My one tip for you would be to reach out for help. There's... it's a very inclusive environment that you're in, and we all know what it's like to be a new computer science teacher that's struggling and not knowing where to turn.
JAMES: Let's hear from Ethel now, who started with her suggestions for K to 12 teachers, known as primary and secondary here in the UK.
ETHEL: If you've never taught programming, I would suggest that you can start with block-based programming because it's so friendly for people who are learning programming for the first time. Block-based are good because the, the students will not worry about the syntax errors, which in research has been shown to be the biggest problem of novice programmers. And they will just be worrying about the high level ideas of, you know, connecting concepts and making some kind of movement.
JAMES: Ethel's PhD focused on how to ease the transition from a block- based language like Scratch to text-based languages like Python or Java. She kindly shared what she uncovered in her PhD.
ETHEL: What we can learn from it is to think about how learners learn and learners learn based on similarity. It's actually a common thing for, for human beings. We learn based on how familiar we are with the environment or the concepts we are being introduced to. When you are transitioning learners from block-based to text-based, yes, they looked different. But yes, within those blocks, again, there are some words written, right, that are showing some type of syntax.
As human beings, we, we start learning grammar when we go to school, right? And when we get into programming, we are still learning some type of grammar, but we call it the syntax. For example, in Scratch, we do have if statements, and that's so obvious, my ten-year-old, he loves if statements because they, they are the powers of how this world of game creation he's in. So when we already have if statements, it's something that learners are familiar with and when you give them if statements in Python, which is text based, it's going to be an automatic transfer because you don't need to put much effort in trying to explain that. Because they connect similarity-wise implicitly.
But when they are now, maybe doing looping, right. And yes, they do it also in blocks, but when they get to do it again in, in an object-oriented language like in Java or in Python, sometimes the mappings don't become so obvious because now they are starting to see, maybe you are introducing functions in your code, which they were never really thinking about in Scratch, right? And suddenly you are just trying to move this thing around using functions or methods and they don't know that.
So how then will you connect things that don't look similar? The best thing would be to use contextualised examples. Let me talk about the context of maybe creating a game. Okay. Rock, paper, scissors, or whatever you could be doing in the block- based environment, whatever the games you could be designing there, you can still give the same type of example when you transition.
So the connection there is on the examples you are giving, the analogy — that's where you connect the two pieces. So the student is realising this thing I've been doing it and now it's just a different representation and I'm learning it this way. So we need to think carefully about making connections. And by using similar examples across the two representations of programming languages.
JAMES: Thank you, Ethel. We've got a comment from Mark Molyneaux on our LinkedIn that agrees with Ethel. Mark wrote:
Start with a block-based system so that students can visualise what they are working on and provide them a foundation for understanding core programming concepts. Then transition to a text- based language using anchor charts to show comparisons in the syntax.
Thank you, Mark.
Right. Let's start with Laura James' three top tips for how to engage her students with programming.
LAURA: So rather than going into abstract concepts right from the start, I try and hit them with things that they're going to find interesting, projects that are going to produce actual, visible, or engaging results. So, you know, things like games or interactive websites or apps that they can produce quite quickly. That tends to give them the hook.
My second tip would be to link to their interests. So if they're interested in music, you could maybe get them to make an app that mixed beats, for example, if they're interested in social media, you know, they could be making meme generators. Anything that, you know, you can see that spark of interest will really keep them at it through the tricky, tricky parts, which will eventually come.
My next tip would be to celebrate failures as learning opportunities. Now, I know you've probably heard that in your teaching career beforehand, but debugging is a huge part of programming. So normalise the experience of things not working, normalise this struggle and celebrate those small wins that your students get when they fix a bug on their own, or when they identify where their program isn't working.
Programming sometimes feels impossible at first, and you've got to make sure that the students understand that debugging is perhaps 90% of programming, and when they can actually build that resilience and that confidence in their own abilities to be able to spot problems themselves, that will make them come on in huge leaps and bounds.
JAMES: Geoff Matheson sent us a top tip that ties into Laura's third one there. Geoff wrote on our LinkedIn:
Errors are your friend. The students who get better the fastest are the ones who run the code most often.
He also says:
Once students get past worrying whether or not the code will work first time and instead use it to get useful feedback, they're well on their way.
Thank you, Geoff.
Over to Ethel Tshukudu for her three top tips.
ETHEL: Before I even go to my top tips, I would like to commend the teachers who take it upon themselves to do the, these introductory programming classes to K-12 students, even, you know, to university students because we, we this is these are concepts we need to be learning today that very important to learn irrespective of the introduction of AI. We cannot let the AI systems create all our problems. We still need human interventions. So I commend the teachers for the efforts they make with, with introducing students to these important concepts of programming.
My top tips are: Go to the level of the student. Sometimes we, you forget how you yourself learnt how to program the first time. So sometimes there's this big gap between the teacher and the student that the teacher is not aware of. So you need to try to go down to the level of a learner and try to understand. So one way to do that is to give anonymous polls during the class to get where they are. Have they ever programmed before? If they have, which languages were they using?
So moving forward you teach for transfer because there is no point in teaching someone the first language and not trying to continue where they stopped, and teaching the second language like that, learning the first language. So if you have this baseline information about your students, you will be able to interact with them more meaningfully and teach for transfer during your sessions.
Connecting concepts like I already said earlier. And the third tip will be contextualisation.
JAMES: Ethel had a good example of when contextualisation worked especially well from her experience with CS Ed Botswana teaching students in the region who had no experience of programming at all, how to program.
ETHEL: CS Ed Botswana was started when I finished my PhD in 2022, and I was like, how can I help the people from my country to learn programming so that they can be able to solve their own problems or just ignite the interest in these younger ones as they grow up. So it's been ongoing for three years.
In CS Ed Botswana, we have been dealing with students who had not had interactions with any type of programming at all. So they were learning from scratch with our initiatives. In our case, we were using the head programming platform. So these were existing activities, but it was not contextualised. Right. They were talking of pizzas, of restaurants and our, our students’ inputs are "That, that's not that daily thing."
So we had to sit down with programming language designers and change the activity to the context of Botswana. When we started naming restaurants in our Setswana - "tuck shop", you know, and the food we were using, traditional food, we, we had over 200 students doing coding in their contextualised way in, in using their traditional meals. And to add things on, we used Setswana in some of the variable names. And the feedback that we got, they were saying, "We never had an idea you could code in our language", you know?
JAMES: Next, Ben Schaffer, who, as I said, teaches teachers to teach programming. Here are the three things he learned from teachers as they reflected on their experience of being the learner.
BEN: Learn how to recognise small wins, right? How to recognise that every little step is a part of that process.
Number two, understanding that that learning to debug and test your code isn't just something you do along with coding, but it's actually part of the process of coding, right.
Learning that reading code — PRIMM, Parsons Problems — some of the classic techniques for, for teaching that we, we sometimes overlook, really are essential ways to help novice programmers advance to become more experienced programmers.
And finally, learning that, that programming has to happen collaboratively, that programming and learning how to program really is a better experience when you're working with your peers on things that are meaningful and interesting to you.
JAMES: We got a top tip suggested by Pete Dring that agrees with Ben's second tip. Pete says:
Learning how to read code helps learning how to write code. Lots of code comprehension activities helps students identify and understand concepts, and remember the terminology that they'll need to make sense of error messages when they start debugging.
Thanks, Pete.
Ben's third point was about the power of social learning, and Laura and Ethel agree. Here's what they said.
LAURA: I really rate things like pair programming. So not necessarily every single lesson, but get the students work in pairs, get one student to be a passenger, one to be a driver. And that really does help, you know, teenagers to become more fluent in describing what they're trying to do. And they can spot each other's errors. And it's really nice to hear some of the conversations about how they're understanding how their code is working or not, as the case may be, and they tend to really enjoy those kind of sessions. I know it's not necessarily ideal for all students, and some of them probably hate the idea of sharing a keyboard, but occasionally that seems to work really well.
ETHEL: I do participation exercises where students do live coding for 15 minutes, so they get to talk about it and we walk around, we get to talk with them. We see where the misconceptions are, we are correcting them right in the classroom. So let's not enjoy talking the whole time, it's all focusing on us for the whole one hour 15 minutes of your lecture. Break it into smaller chunks, it's you then the students, then back to you, then the students. That can help our learners to feel like they belong in our classrooms. And they, they can look forward to coming to their class to learn programming.
JAMES: To our final guest, then, Dorian Love.
DORIAN: I think my top tips for, for teachers teaching programming is try and use semantic waves.
JAMES: If you haven't heard of semantic waves, Dorian has an article in this issue of the Hello World magazine that explores it, and we've asked him for a quick definition.
DORIAN: It's not an easy question. Semantic wave is, is basically, a description of how abstract or how concrete, how simple or how complex something is. And a wave describes the need in education to move between the simple and the complex and between the abstract and the heavily contextualised. And, I think the semantic wave is, is particularly steep in computer science education.
Computer science is notoriously difficult subject to teach, and I think there are many reasons for that. Amongst them, the fact I think that you have to teach not only to solve problems in the real world, but you also have to teach a computer programming language. And it's about solving a particular problem in a particular context, but also generalising out, ideas in computer programming. And I think that's particularly difficult for students.
The best approach really is to be moving between abstract and concrete, between simple and complex all the time. I start thinking, uh-oh, I'm teaching at too abstract a level. I'm flatlining. And so I kind of self-correct. Or it could be that I'm remaining at that kind of very heavily contextualised level. And I say, okay, I'm flatlining there. I need to link this to the ideas that I'm trying to teach. So I think it quite directly makes me more conscious of what I'm doing as a teacher. And it's quite a simple visualisation. I'm too much up here. I'm too much down there. And then you kind of self-correct.
JAMES: So Dorian's first tip to help teach programming is to be aware of semantic ways and use it to modulate how you teach. His second tip is to use real-world problems.
DORIAN: Students find real-world problems really motivating because they get a sense that, it's important computer science is not just an abstract thing. It's something that has value and has purpose in people's lives. And I think for girls especially, I teach girls, it's particularly important because, I don't think, you know, if, if a girl looks at the world of computer science, I think they see men fulfilling those roles. So how do I fit in? But if there's real-world problems to be solved, I think they can see how they might fit in.
JAMES: We have a brilliant previous episode that explores how we can empower more girls in computing. Definitely go and listen to that if you haven't already. Quite a few of your top tips focus on the power of solving real-world problems.
Asim Panda said:
If you're learning to code, the best way to start is by solving a real problem. Pick something simple, like figuring out the total cost of items in a shopping cart. Break it down. List the prices. Add them up. Apply any discount or tax.
Now think like a programmer. What pieces of information do you need? Those are your variables. Things like item prices, discount rate, and tax. Then write functions that use those variables to do the work. One function adds the prices, another applies a discount, and so on. It's all about turning the logic into code, step by step.
And Zenas Awuku wrote that:
Logical thinking and problem solving are key. I always emphasise that programming is simply a tool for expressing your logic in solving problems. Once students understand this, it becomes more practical, relatable, and less intimidating.
Thanks, Asim and Zenas!
I interrupted Dorian. Sorry Dorian. Let's return to something he suggests you need to consider when using real-world problems to teach programming.
DORIAN: If you're using problem-based approaches, one of the big difficulty areas is going to be how to model the world in such a way that it, it can be solved using a computer. And you've got to quite carefully think about how you're going to scaffold those activities so that they get the information that they need to be able to solve the problem.
I had a student in the class who was trying to use a micro:bit. Their idea was that they were going to solve a problem of an environmental problem, forest fires, and they were going to set up an alarm system. So the micro:bit was going to detect forest fires and then notify, you know, the fire department or whatever it is that they needed to take action.
And they were really struggling with how to to model the problem. How would something detect a fire? And I had to, to sort of quite carefully scaffold for them that understanding of a model of the world with what is fire? Well, fire has certain properties. It has light, it has heat. There's smoke.
So could a micro:bit actually detect any of this? And I had to quite carefully scaffold it, understanding that, yes, you could measure temperature, for example. Or you could measure brightness, might tell you there was a fire going on. We couldn't decide on how to detect smoke, but nevertheless, just using those two properties, it then became a lot easier to... having modelled that problem, if the temperature is above a certain amount, if the light is above a certain amount, then there might be a fire, send the alarm.
Very often the programming is actually the easy bit. Trying to understand the problem and trying to understand the world is the difficult part.
JAMES: Dorian's third and final top tip is all about his love of physical computing, using code to make digital devices sense and interact with the physical world through hardware like sensors, motors, and control boards like a micro:bit or a Raspberry Pi.
DORIAN: You think about what could make it easier to, to create computer programs. You know, I thought, okay, physical computing because you able to bridge that gap between abstract ideas, the theory, and the kind of hands-on aspect, that you think it's a match made in heaven, but actually physical computing is incredibly difficult for students because, it involves, devices, output devices. It involves electronic circuits that they have to create, and that's a whole new level of knowledge that they need to add to the computer program.
So I had a class that was creating, a sound-activated chocolate dispenser and the whole idea is that if you clapped your hands, the servo motor would lift the flap and the chocolate would come shooting out. But to get the, the class to understand how does a servo motor work? How is it connected to the micro:bit? How does the micro:bit measure the sound and then activate the, the, the output that will open the servo motor? All of that is, is levels of complexity. That is a lot more than just creating a simple program.
So again, you know, the program is often the easy bit, understanding how components fit in and, how to model your solution using the electrical components is actually very, very hard. And students really struggle with that.
Don't be afraid of explaining things, just because, you know, we're all supposed to teach in a constructivist way, and we're supposed to be the guide on the side. Kids actually need to have things explained to them. What is a servo motor? How the hell does it work? The most efficient way is to actually tell them what they need to do to make it work.
JAMES: Aula Jazmati on X agrees with Dorian's passion for physical computing:
Encourage hands-on projects that solve real problems. This fosters creativity, builds confidence, and makes learning engaging by showing students the practical impact of their code.
Thanks, Aula.
Let's hear one last time from Dorian.
DORIAN: I think also, you need to be genuinely interested and genuinely excited about what you're doing. Because if you can convey that love of programming, the love of solving problems, it's quite infectious.
JAMES: Our teachers agree, Richard commented on Instagram saying:
Get started, make mistakes, make something you want to see working and have fun doing it.
And Thomas Berggren wrote on LinkedIn:
Start simple and make it fun!
We really hope this episode has given you some ideas for both of those.
On your way next week, we ask whether 'vibe coding' has a role in programming education. And we hear from a university academic, a secondary school teacher, and a student who have each investigated the use of AI tools to support students learning to program.
And the week after that, we're asking which programming language you should choose to teach coding. I lead a fun discussion around the pros and cons of using Scratch, Python, Java, and other programming languages to teach coding skills at different learning stages.
To listen or watch those podcasts, head to helloworld.cc/podcast and helloworld.cc is where you want to go and subscribe and read the latest issue of the Hello World magazine.
We hope you find the Hello World magazine and podcast inspiring and that they help you to engage and educate young people in computing. Bye.