Teaching coding to kids is difficult. And to paraphrase John F. Kennedy, that's why we choose to do it and why we enjoy it.
Teaching coding properly is difficult – and in this blog post I will explain why – but this approach makes learning it easy for kids. So we'd rather make our life difficult as instructors to make the children's path to learning easier.
Teaching coding properly is difficult.
But this approach makes learning it easy for kids.
Although there are many similarities between teaching coding for kids, and teaching them other subjects, there are also many important differences.
In this blog I will talk about how to approach teaching coding, the techniques needed and the skills required by those designing the course and teaching it.
Why is coding hard to teach?
With many subjects, it is possible for a teacher to teach those subjects without having extensive professional experience in it. It is not necessary for someone to spend a decade working as a research scientist to teach science, and it is not necessary to have worked as a professional mathematician to teach long multiplication or trigonometry. Of course, if a teacher does have years of professional experience in the subject they teach, it can definitely help, but it is not required.
Not so with coding. There is a very big gap between theoretical knowledge of programming and the practical aspect of it. In fact I will go further and state that it is impossible to have a good theoretical knowledge of coding without having extensive experience writing code.
Teaching how to write good code, not just code that works
Another way of thinking of this is as follows: It is easy to write bad code, but it is much harder to write good code. When programs are short or simple, it may not matter too much if the code is written well or badly, as long as it works. But once students get used to these bad practices, it becomes harder to change them.
As a result students will find it harder to progress to the more intermediate and advanced topics in coding and to write more complex programs. The risk is that they get disheartened at that stage and give up. Or alternatively they stay at the relatively beginner level without moving forward, often believing that they know everything there is to know in coding.
As teachers we need to make sure we steer students towards writing good code, using best practices right from the start, and to be able to explain to them why certain practices are not desirable.
Supporting students effectively and allowing them to be creative
Coding is sometimes taught (not by us) as follows. A teacher has a carefully prepared program. They write it down, explaining it to the students. They then ask the students to copy it and to tinker a bit with it, changing some values here and there.
The reason this does not work is because it's quite boring (for both students and teacher) and it doesn't really teach the students how to write computer programs, only how to write that particular computer program.
However, giving the students the freedom to explore and code independently, and allowing them to be creative and take the projects in different directions requires a very experienced programmer. A teacher needs to be able to think quickly about what the student is trying to do, plan the next four or five steps of the code in their head, and all this for several students at once. This is not hard for programmers who spent many years writing code (a lot more complex than what the children are working on), but is a very big challenge for inexperienced coders.
Dealing with errors and bugs
One of the most important aspects of writing code is dealing with errors and bugs. An error is when the program won't run and will give an error message. A bug is when the program runs but doesn't give the desired outcome. Some are straightforward to fix, others aren't. An experienced programmer can spot errors very quickly and start guiding the students right away. A less experienced coder may need to spend quite a bit of time finding the problem, time which would be best spent on actual teaching.
The easy way of teaching "coding"
As coding has become more mainstream in children's education, the problem of lack of experienced programmers within schools led to several solutions. The most popular by far is to use children-specific platforms such as Scratch to introduce kids to some of the basic concepts in coding. Typically these platforms use blocks that can be dragged around, a bit like iPad games that young children use to learn how to spell.
Let's be clear. Playing on these platforms is not coding. It does introduce some of the concepts but it can also give a false impression of what coding really is. It's equivalent to having kids stick with the iPad games dragging letters into words instead of moving them on to reading actual books.
For teaching coding in schools, there is no other apparent easy option as there will never be sufficient people with extensive coding knowledge employed as teachers in every school. These platforms enable any other teacher to be able to teach "coding" to kids.
The question that should be asked is whether they should be used at all. One side of the argument is that it's better than nothing. The other view is that it gives the wrong impression of coding and children often get bored of using these platforms and, as they believe this is what coding is, get bored of coding. But this is a discussion for another blog.
The hard way of teaching coding
(the only way, really)
So, we don't want to use children platforms. And we don't want to have to write code and ask students to copy it.
This leaves us with the hard way of teaching coding, using a full, proper coding language such as Python while allowing students to explore, experiment and be creative. Our role as instructors is to steer students away from bad habits, make sure they truly understand what's going on and help them find and correct errors.
There are two distinct aspects required to learn how to code. The first is to know how to use the various tools, and when to use them. The second is to be able to use several of these tools all connected together in the right order in a complex project. The first is relatively easy. The second is much harder. When we teach children we need to be able to cover both aspects, including working on complex projects with many "moving parts" that will teach the students not just how to write commands, but how to plan, construct, write and test a program.
We choose to teach coding not because it is easy, but because it is hard.
The fun way of teaching coding
(it may be hard to teach, but it makes it easy to learn)
How to make learning to code fun? In one short phrase: use engaging and exciting projects. This sounds obvious enough but too often coding is taught through short, technical exercises with no real purpose. Stu