This is a question which has been bugging me for some time now – how do you actually teach someone to program? I don’t mean which language, or what resources should I use, or what time of the day is optimal. I mean what is it in your teaching which switches on the little lightbulb that makes a student able to think through the logic of what they want to do and translate that into code? I have recently been working on my Spanish using Duolingo and I sense that my own language learning is a little like what I’m seeing in the classroom with students who learn to code.
Here are the stages I often see in the classroom:
This is the first stage where the student is confident to use familiar concepts such as input, print, if/else etc. The student can memorize syntax and fix any errors that may occur. Confidence at this stage is usually quite high as it is early on in the learning journey, and you have probably provided a lot of help as well as offering fairly small and basic tasks. (Check out the super awesome diagram below produced by my art department.)
Pile of Lego
This bit is horrible for teachers. So, you’ve given your students a huge pile of programming building blocks to work with – they have understood conditions, loops, arrays, all the basics are there. So there you are with your special occasion turquoise pen, filling in your planner with glee, when you decide to set a more difficult task which combines some of these together. Here’s my favourite example of such a piece of thinking:
Teacher: Hmm, okay. I’ve taught input, loops and the % operator and everyone in the class did really well in those lessons. I know! Let’s put these familiar things together and ask them to write a program where they enter a number and the program prints out all of the even integers from 1 to the number they entered.
Student: Burrr…what’s an integer?
Now, of course your students have not completely forgotten everything they once knew. They have just worked themselves into a panic (warning, this panic is contagious) because you asked them to put together more than one thing at once. It’s a bit like when on my Spanish Duolingo practice it asks me to write something involving two different tenses and some bit of vocab I only just learnt. Give me a test on each of these things individually and it’s ¡muy bien hecho!, but make me do them all together and it’s not exactly creme de la menthe, if you catch my drift Rodney.
Upset by the loss of their former syntax wielding wizard glory where the challenges were easy and the gratification was quick (thanks a LOT, smartphone game culture x_x), students often get disheartened. Now, the way to program really difficult stuff goes something like this:
- Write some code. It doesn’t matter what it does, or even if you have any idea what it is supposed to do.
- Run your program
- If it doesn’t work, delete words and/or syntax from the code COMPLETELY AT RANDOM.
- Repeat 1-3 until either the code works, someone tells you the answer, or it’s the end of the lesson.
This is where the journey ends for some of the brave adventurers, they choose the wrong path*, Treguard packs them off home with a knapsack and they never enter the computer room again. However, for those who prevail, one day they turn up as…
This student can code. They understand how to put together the building blocks and they aren’t phased by bigger programming tasks, e.g. programming hangman, noughts and crosses etc. They can think through how they will represent what they need to do using variables and data structures, and whilst they are only a kitten in experience terms, they are more than scrappy enough to hold their own in most tasks. I’d say this equates to a working fluency in a different language – good enough for most everyday situations, not good enough to read a newspaper.
But the question I ask is…how do you get your students from monkey to kitten? What is it in your lesson that takes them from random button bashing to confidence in building up their own code? For me, it’s all about the way I teach them to plan. Teaching syntax is satisfying and straightforward, indeed many ‘learn to code’ resources don’t go past the syntax wizard stage because they don’t want the student to lose interest. Teaching mastery is hard. But… that’s a post for another time 🙂
* By the wrong path I mean they probably opted to do something else instead of Computer Science GCSE. 😉