PrimarySecondaryComputing

Teaching coding – Simple steps to help you start & succeed

Cartoon illustration showing small figures alongside a large monitor and notebook with programming instructions to connote concept of coding

Learn how to effectively teach coding in school with this practical guidance…

Teachwire
by Teachwire
National Coding Week resource pack
DOWNLOAD A FREE RESOURCE! National Coding Week – Topical coding activity pack for schools
PrimaryComputing

Teaching coding doesn’t have to be daunting. Here we provide lots of practical tips for starting and teaching coding in both primary and secondary schools, along with creative cross-curricular and extracurricular coding ideas.

Why not try them during National Coding Week?

What is coding?

Coding, also known as programming, is the process of creating instructions that a computer can follow to perform specific tasks.

It involves using a particular language, such as Python or JavaScript, to write code that controls software, apps, or even physical systems.

What does the curriculum say about coding?

KS1: learn the basics of algorithms and simple programming using visual tools

KS2: progress to writing more complex programs, understanding sequences, selections, and loops, while using logical reasoning to predict outcomes

KS3: dive deeper into text-based programming languages like Python. Explore computational thinking, debugging and creating more sophisticated programs

KS4: students who choose GCSE Computer Science develop advanced coding skills, focusing on problem-solving, software development and algorithmic thinking


Is coding hard to teach?

Introducing children to the concepts behind coding only requires you to teach them processes like giving instructions and recognising patterns – coding in its simplest form. This doesn’t even have to be done online or take up a huge amount of time.

To ensure kids get the most out of the experience, see it as an opportunity to learn alongside them and embrace new ways to interact with technology.

Don’t be afraid to deviate from the lesson plan if it feels right, or try something new that might encourage students to think more creatively.

It’s just as important for children to learn what doesn’t work as it is to learn how to code successfully. This also creates opportunities for students to solve unforeseen problems.

Lee Parkinson, also known as Mr P, is a teacher, education consultant and best-selling author. 

Benefits of teaching coding

Coding teaches problem-solving, logic and creativity, as students learn to break down complex problems and develop solutions.

The act of writing code can provide a genuine sense of achievement when you succeed in bringing together a set of commands in order to perform a task and remove the need for manual intervention in future.

“The act of writing code can provide a genuine sense of achievement”

What’s more, this creative aspect of coding can encourage students to develop essential skills and attributes that they can readily utilise and develop in the context of other subjects. This includes problem-solving and skills of analysis, patience and confidence.


Coding teaching resources

You don’t need to be a professional programmer to teach coding. There are dozens of online platforms and apps for learning to program, which will guide your learners step-by-step…

BBC micro:bit – This is a small, programmable microcontroller designed to teach coding and electronics. Use the tutorials and challenges to help children create simple programs that respond to a shake or push of a button.

Bee-Bots – This programmable floor robot will help you to introduce the process of programming instructions in sequence at KS1. Resembling a familiar toy, it helps children learn to give commands, plan ahead and solve problems. Bee-Bot has been around for 20 years and 95% of schools in the UK have one. It offers a debugging process that offers a perfect opportunity for children to work together to solve a shared problem.

Scratch – A free programming language for creating interactive stories, games and animations. Getting started with Scratch is easy. Open up a new Scratch project and select ‘Tips’ at the top of the page. These step-by-step tutorials will guide your pupils through lots of useful projects, which can then be customised by the learner.

Code for Life – This website houses games that support and guide students step-by-step, making learning to code great fun. Get started with Rapid Router, designed for students new to coding.

CS Unplugged – Learning about computing does not necessarily need to involve a computer. There are many ‘unplugged’ activities that you can use to teach the subject. CS Unplugged has loads of free activities that teach algorithmic thinking without the need for electronic devices.

Code Club – This initiative places volunteers in schools to run free extra-curricular opportunities using resources schools already know about, such as the website Scratch.

Raspberry Pi – A low-cost, credit card-sized computer that enables pupils to build projects, run various operating systems, and explore programming.

Code Bug – A programmable and wearable device that can display graphics and text and has touch sensitive inputs.


Primary coding lesson plans and resources

National Coding Week activity pack

Get your pupils thinking like a programmer with this free coding activity pack. Pupils will learn what coding is and where to start and play a variety of offline or online games to test their coding skills.

Use coding skills to beat a hacker

This lesson plan is based around an imaginary scenario involving your classroom door being locked by a mysterious hacker. Children need to battle to escape the classroom at breaktime by solving different tasks.

Build your own robot

Use a Raspberry Pi to control a homemade robot. Can pupils make their creation move forward a particular distance, or forward and then back again?


How to teach coding in Early Years

People often assume that Early Years children are too young to learn coding – a skill that can seem daunting even for some adults. But the truth is, technical skills like coding are becoming increasingly important for our children’s futures.

Coding is like learning a language: the earlier you start, the better. Of course, concerns about putting young children in front of screens are valid, but coding education doesn’t necessarily require screen time. In fact, it’s often best taught unplugged.

In Early Years, the focus should be on sparking an interest in the process and teaching the basic principles of coding – essentially, creating a set of instructions that a computer can follow.

“Coding is like learning a language: the earlier you start, the better”

Educational robots, which resemble familiar toys, help children learn to give commands, plan ahead, and solve problems.

The Bee-Bot, a robotic bumblebee that has been teaching kids to code for over 20 years, is a prime example. Children can program the Bee-Bot by pressing buttons to move it forward, backward, left, and right, with up to 200 commands.

Jo Hardy is director of innovation at RM and governor of Park House Primary.


How to teach coding in primary school

  • Follow the interests of your learners. Let them code resources about their favourite topics – whether that’s sports teams, ponies or pugs.
  • Create topic-themed games, from a virtual sports day to take account of poor July weather, to chariot racing games when studying the Romans.
  • Ask learners to create an interactive presentation on a topic in Scratch. Add clickable items to navigate the information. Pupils can even create self-graded quizzes to test their peers, or a themed game based on what they have learned. 
  • Create animations, using ‘motion’ blocks to move characters and props, ‘looks’ blocks to add speech and thought bubbles and ‘sound’ blocks to add recorded voices and Foley artist sound effects.
  • Create simple ‘paint by number’ activities by changing the colours of a picture using ‘looks’ blocks to add colour when a section is tapped.
  • Ask learners to design a digital ‘dot to dot’ activity, which adds lines when the next number is tapped. 
  • Create digital on-screen musical instruments which produce sound when tapped. Ask your learners to record their own novel sounds for their instruments.

Even more ideas

  • Make classroom resources for learners lower down in the school to promote cross-year cooperation. Younger learners can be interviewed about what features they would like in the coded resource and product-test the prototypes to give feedback to improve later iterations. 
  • Design real-world resources for an audience outside school. Share coded products online for parents to access.
  • Delegate re-coding an online homework page to your learners, so parents know what the weekly tasks are. The same can be done for a class diary of events or a class news or FAQs page. 
  • Design simple tools that can be used in the classroom, such as a basic interactive behaviour chart. Create number variables that change when an image or text, such as a learner’s name, is clicked on, to increase the learner’s score. 
  • Create a volume monitor for quiet work times by using ‘sensing’ blocks of code to develop a visual response to the sound level in your classroom. 
  • Build a whiteboard resource that students can tap in the morning to indicate their lunch preference using a binary school dinner (1) versus packed lunch (0) variable, which automatically adds up the totals for you. 

Martin Burrett is a primary teacher, EdTech specialist, editor at UKEdChat, and author. See ictmagic.co/books to view his books on computing and coding. Visit ictmagic.co/8-ways to find more classroom coding activities. 


How to teach coding in secondary school

1 | Introduce hardware

In secondary school, it is important for students’ knowledge to be as practical as it is theoretical. Coding hardware plays a vital role in meeting this objective.

Simply put, hardware is the physical components of computing and robotics, while software is the code – the instructions responsible for bringing the hardware to life.

Establishing this difference is a great motivator for students’ continued learning. Introducing coding hardware to the classroom increases the opportunities for experimentation and creativity and allows pupils to build upon existing knowledge.

2 | Build robots

Building robots with students is a fun way to develop a wide range of skills that also adequately prepares them for jobs in the 21st century.

Start by building robots using resources like DFRobot, SAM Labs, or littleBits. Then ask students to bring their creations to life with code.

Activities like these provide students with an opportunity to apply their coding knowledge practically. Working with sensors and motors helps enhance their coordination and motor skills.

Robots are also a great tool to facilitate blended learning and cross-curricular exercises in the classroom, addressing topics like climate change, engineering and physics.

3 | Innovation hour

Hour of code‘ is a popular global movement for students embarking on their coding education. However, as students’ knowledge increases, so must the complexity of the concept with which they engage.

For secondary students whose attainment needs to be pushed to greater lengths, consider swapping an hour of code for an innovation hour.

The thinking behind this is simple and is based on learning through play or experimentation. To begin, provide students with scale-able and widely compatible hardware resources such as science kits using micro:bit, educational robots and ‘maker’ kits.

Setting the clock with a one-hour limit, ask students to embrace their creativity and create a coding resource that solves a particular problem.

The limitless potential is a huge benefit of this approach. The task can address any number of challenges such as building a communication tool or regulating the pH level of soil while developing creativity and problem-solving skills.

4 | Run a coding club

Take the learning experience beyond the classroom and provide students with ample opportunities to stretch their knowledge base.

Coding clubs are a great way to really grow students’ practical coding hardware skills as it breaks free from the constraints of curriculum.

What’s more, coding clubs are free from the pressure of knowledge attainment for exams. This means students can pursue learning opportunities that interest and challenge them, naturally leading to more engagement with the subject matter.

5 | Take part in coding competitions

There are few things as effective for engagement as a little friendly competition. What’s more, coding competitions are a great way for pupils to put their skills to the test, get their hands dirty, and apply their knowledge to practical applications.

As they encourage working in small groups to complete tasks, competitions are also a great exercise in teamwork and collaborative problem-solving. These are soft skills that are equally as important as technical coding knowledge.

There are many competitions available for pupils in the UK, including the UK Bebras Computational Thinking Challenge.

Ricky Ye is the CEO of DFRobot, a world-leading robotics and open-source hardware provider empowering the community of future creators.


Extracurricular coding ideas

Extracurricular clubs are a good way to let children who enjoy and excel at coding to fly with it. They also support pupils who don’t have ready access to computers at home.

Build on something else

Let children ‘remix’ what they have been working on in class, or tinker with some of the examples already in Scratch.

For example, open the ‘Dance Party’ starter project and click on ‘See inside’ to allow the children to add more characters and change the speed, colours and dance moves.

The trick is to find activities that can produce results pretty quickly (like an animation), but can then be tinkered with and built on. Don’t be afraid to supply something already done and let the children put their own stamp on it.

Give specific challenges

After mastering the basics of BBC micro:bits, set the children the task of making something involving them, such as:

  • Fortune teller (with the micro:bits responding with ‘yes’, ‘no’ or ‘ask again’)
  • Emergency vehicles (where the micro:bit flashes)
  • Road safety signs

Let them lead

Let older children use activities from code.org to give younger children a flavour of coding. Or create and animate a sprite in Scratch using only the ‘move’ and ‘turn’ commands.

Limiting the commands used has a canny way of allowing the children to be even more creative.

These kinds of clubs are my favourite as the children love running them and the younger pupils are always so impressed with what they can do – there’s lots of ‘oohs’ and ‘aahs!’

Rebecca Stacey is headteacher at Castle Carrock Primary in Brampton, Cumbria.


Cross-curricular coding teaching ideas

By highlighting interdisciplinary connections, we can make coding lessons more engaging and relevant to other areas of our students’ lives…

Mathematics

Use mathematical concepts like algebra, geometry, or statistics to illustrate coding principles. Explain how variables in coding are similar to algebraic variables (the value of x or y).

Geometrical concepts relate to the design and positioning of characters in games, as well as the calculation of trajectories to ensure that they’re realistic.

Art and design

Focus on using colour theory, balance and aesthetics. You could link this to front-end web and app development and user interface/experience principles.

Refer to the hex numbers we use to identify shades. We utilise these in code to select and render colours.

Science

When teaching simulations or data analysis we can refer to scientific theories and phenomena. These can help to show how we can use coding in modelling and analysing large data sets to predict real-world scenarios, outcomes and events.

A grasp of the scientific language commonly employed in modelling will support students in better understanding the outcomes presented.

MFL

Comparing coding languages to spoken languages can be a big help when explaining the syntax used within coding.

Coding languages differ in the same way spoken languages do. Both can refer to the same objects and functions using different terms and ‘vocabulary’.

This analogy can extend to grammatical differences between languages too. Programming syntax will similarly vary between one coding language and another.

Physical education

Common coding concepts, such as algorithms, are now used more than ever in sports training. This is to better understand the impact of injuries or illness on performance, and to hone in on specific areas for potential development.

Creative arts

Compare holding down the strings on a guitar to play chords to coding logic through examples such as ‘if’ statements.

If you hold a particular number of strings down and played them multiple notes will sound. We can also teach coding through music composition or the act of creating digital art.

There are coding platforms available that will enable students to bring musical instruments together, control them and create music using programming commands.

Business and economics

We can explain how coding across a number of different applications can be utilised for business analytics.

The code used to analyse data from market research can support the development of new applications designed to solve identified business problems.

The code used to create websites can be made to gather information about a business’ target audience and geographical location.

Environmental studies

Coding expertise within the context of sustainability projects is set to become a highly prized and sought-after skill.

We can demonstrate just how important it is via lesson activities involving sensors of the type that authorities might use to monitor heat, wind or water levels. How can we make these trigger environmental defences?

You could also reference key figures in the field of environmental science. Explore their use of coding and applications to simulate climate patterns, predict weather changes and analyse the impact of human activities on the Earth’s ecosystems.

Rob Wraith is head of learning technology and digital learning at NCG – a group of seven colleges across the UK; for more information, visit ncgrp.co.uk.


Thanks to Rob Whitehouse for his help with this article.

You might also be interested in...