📣 Change is coming! 📣 All new Teachwire launching May!
📣 All new Teachwire launching May! 📣
Teachwire Logo

3 Ways To Teach Coding And Nurture Confident Programmers

Choosing the right resources is the first step, says Terry Freedman, but how you share them with your students is just as important

  • 3 Ways To Teach Coding And Nurture Confident Programmers

Regardless of the specific applications you use to get your students coding – and there is a fantastic range of brilliant options at your fingertips these days – there are various approaches you could take to ensure your course of study is delivered effectively, and actually results in those young people becoming competent and creative programmers by its completion.

Here, I would like to outline three of the most widely used, and offer a quick run through of the pros and cons of each:

1. Drill and practise

In this approach, you teach the code required for small, ie limited, uses, and then have the students practise using it, so they gradually build up their knowledge. This is the method used by some online coding courses, such as Code Academy.

For example, a popular starting point is to teach the code for displaying “Hello, world”. An alternative version might be to pose the question, “How old are you?”, and have the computer respond by displaying “You are [x] years old.”

There are some advantages to using this approach.

First, it is possible to get results very quickly, and this can be very motivating.

Secondly, you can introduce potentially complex ideas such as variables and conditional statements very easily. For instance, the age example given above introduces a variable. We could make it more interesting by introducing conditions: if the person’s age is lower than 15, display “Sorry, you’re too young”, and if it’s greater than 15, display “Sorry, you’re too old.”

You could also introduce a variable into the first example by asking for the person’s name, and then have the computer display “Hello, [name].”

This approach may be useful as an introduction to computer programming, or for the introductory lesson for new concepts.

It is, however, of dubious value as the sole means of teaching the subject. Quite simply, people (even students!) need a reason to do something, and while getting the computer to say “Hi” may be fun, the novelty soon wears off.

It is unlikely that young people would remember what to do or how to apply what they’ve learnt, unless they have a very good reason to do so. Used unwisely, then, this approach could simply replace ‘death by PowerPoint’ with ‘death by [programming language]’.

2. Structured problem solving

In this approach, you teach kids some code, then set them a problem that can be solved using what you’ve taught them; the students have to decide which bits to use, and justify their choice. I refer to this as ‘learning on a need-to-know basis’.

Let’s suppose you teach students how to make decisions based on using IF functions in a spreadsheet, lookup tables in a spreadsheet, and IF statements in a computer program. You then set a problem that requires the use of one or more of these in order to solve it, although you don’t tell the students that. You ask them to solve the problem using any of the knowledge they have learnt so far, and to be prepared to justify their approach.

In effect, the problem is disguised, and the students have to do a bit of detective work to pinpoint exactly what it is they have to solve, and therefore which aspects of what they have leant might be applicable.

For example, if the task is to organise a parents’ evening, one aspect of it might be to arrange for parents to go to different parts of the school, at different times, depending on which year group their kids are in. In order to automate the process in some way, there would need to be a way to deal with parents who have kids in different year groups.
You can see from this briefest of descriptions that this is a potentially rich source of exploration and discussion, and a problem having several different solutions. But they all come down to the concept of IF in some form or another.

3. The discovery learning approach

The third approach is to set students a problem that cannot be solved using what you’ve taught them so far. This sounds quite counterintuitive, but it has been used very successfully in maths.

Jo Boaler, in her book Mathematical Mindsets, cites research from both the USA and England that found that students who were asked to explore a problem before being given the means to solve it performed at significantly higher levels than students who had been taught in accordance with the first two methods described above.

In essence, it involves a reversal of the usual sequence, which is to tell the students how to carry out certain operations, and then give them a task or a problem to practise on.
Can this approach work in computing? From my own experience, I would say definitely.

For example, in one of my Year 10 classes, I gave the students the task of creating a system whereby a shop could automatically apply discount in various circumstances, such as if a customer spent more than £100 in one transaction. But I didn’t tell them how to go about it.

One group of students decided that what they needed to do was to create a program that would cover not only the scenarios I’d suggested, but any future ones I might come up with. They eventually came up with an approach that seemed to work.

A huge advantage with this approach is that students’ interest is kept high, possibly because we ourselves are programmed to want to solve mysteries. Albert Einstein said that a mystery is the most beautiful thing we can experience. Coupled with this is what psychologists refer to as the need for cognitive closure: until we manage to solve a problem, it gnaws at us and demands our attention. This focus on the problem and how to solve it makes the learning more memorable, especially if the task is interrupted (such as by the end of the lesson in a school situation); a phenomenon that has come to be known as the Zeigarnik effect after the person who discovered it.


In practice, you will no doubt wish to use a combination of these methods. The important thing is to use them mindfully: experiment with them, and work out which ones work best for your students in different circumstances.

Terry Freedman is the author of Education Conferences: Teachers’ guide to getting the most out of education conferences, available on Amazon, and publishes the ICT & Computing in Education website and the Digital Education newsletter at ictineducation.org.

Sign up here for your free Brilliant Teacher Box Set

Make sure your assessment is effective with these expert insights.

Find out more here >