Blog

So first of all I will lay may cards on the table – I am a CS teacher working with pupils from KS2-KS5. And I reckon in my 25 years of teaching, I have fallen into any and all of the traps I am about to argue against. But I will offer some ideas about how I feel programming is best encountered by pupils through KS2.


It isn’t uncommon to see or hear teachers discussing what else they should buy for computing. “I’ve got X amount to spend, what should I buy?” Or talking about what they teach in terms of the software/hardware that they use – “Y1 – BeeBots, Y2 – ScratchJr, Y3 – Scratch, Y4 – MicroBits, Y5 – Minecraft, Y6 – Python.” (or similar) and seemingly justifying learning through this.

This was me!

Underlying this seemed to be the idea that the more kit we have, or the more software envoronments/languages we use, the better computer scientists we will produce. And if that is you, I’d like to suggest a different approach.

Use the Building Blocks

Firstly, I would encourage primary schools to stick to block coding, and avoid the rush to text-based alternatives. Build familiarity and an environment where pupils feel confident to solve problems for themselves. Block coding can help reduce cognitive load, reducing errors in programs by eliminating common syntax errors which often frustrate text-based programmers. Block based coding allows pupils to concetrate on the algorithm and iron out logical errors in their code. It is worth noting that even the National Curriculum at KS3 says that pupils should:

“use two or more programming languages, at least one of which is textual, to solve a variety of computational problems;”

National Curriculum – KS3
https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/239067/SECONDARY_national_curriculum_-_Computing.pdf
A simple quiz algorithm

In fact, I have heard many teachers at KS3 talk about starting with Scratch, to ensure that pupils have covered a range of coding constructs. I too show pupils what a typical program looks like that they might have done in Scratch, before demonstrating how this is perfomed in Python. We look at how Scratch sort of puts the brackets in and applies the indentation for you. Surveying my pupils in Y7, I found that around 95% had used Scratch before.

The danger of moving to Python too quickly is that you spend a lot of time ironing out syntax errors related to typing rather than developing their computational thinking.

For a few years I experimented with text-based coding using both Small Basic and Python in Y6, but both my experience as a teacher and the pupil experience was limited, and most of the focus in the classroom seemed to be around “copying code and getting it to work”. My reflection after a while was that there was little computation thinking or creative problem solving going on. In fact, it felt like I was doing all the work and not the students.

Limit the “Langauges”

Particularly at KS2, I would encourage teachers to limit the number of programming environments that pupils use. To make an analogy, we don’t believe that people are great linguist because they can say “hello” in 25 languages. A great linguist will delve deep into a language, understand the culture, context and breadth of it, and be able to construct complex sentences using a wide range of vocabulary.

Similarly in coding, I would encourage Computing Leads to limit the number of language environments pupils are working in, and concentrate on being incredibly familiar with one or two. I now tend to stick to Scratch and MakeCode at KS2, to cover on-screen and physical computing. I sometimes give pupils a little Blockly in the form of Rapid Router or similar, but my main focus is on deepening understanding in my main two environments.

Build Conceptual Understanding

So instead of developing use of a wide range of coding software, I set about ensuring pupils grasp as many coding concepts as possible in order to solve a range of problems. Below are the KS2 National Curriculum Aims, and it is clear the focus is on the “fundamental principles and concepts”, “analysing problems” and “writing programs in order to solve such problems”.

Aims

The national curriculum for computing aims to ensure that all pupils:

* can understand and apply the fundamental principles and concepts of computer science, including abstraction, logic, algorithms and data representation
* can analyse problems in computational terms, and have repeated practical experience of writing computer programs in order to solve such problems
* can evaluate and apply information technology, including new or unfamiliar technologies, analytically to solve problems
* are responsible, competent, confident and creative users of information and communication technology.

National Curriculum KS1 & 2
https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/239033/PRIMARY_national_curriculum_-_Computing.pdf

Much of my earlier experience in teaching coding was about me showing pupils how to solve my problems that I had set. In addition, I felt that if I taught them how to solve problems with more languages/environments then I was clearly doing a better job.

Now my aim is to develop confident problem solvers who can debug their own algorithms to solve their own problems. I’ve included the subject content statements from the KS2 and KS3 NC documents below

Programming Subject Content

KS2KS3
design, write and debug programs that accomplish specific goals, including controlling or simulating physical systems; solve problems by decomposing them into smaller partsdesign, use and evaluate computational abstractions that model the state and behaviour of real-world problems and physical systems
use sequence, selection, and repetition in programs; work with variables and various forms of input and outputuse two or more programming languages, at least one of which is textual, to solve a variety of computational problems; make appropriate use of data structures [for example, lists, tables or arrays]; design and develop modular programs that use procedures or functions
use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programsunderstand several key algorithms that reflect computational thinking [for example, ones for sorting and searching]; use logical reasoning to compare the utility of alternative algorithms for the same problem
understand simple Boolean logic [for example, AND, OR and NOT] and some of its uses in circuits and programming …
National Curriculum KS2 and KS3

What does it look like

Let me take just one example, creating a quiz…



When we first meet seletion, creating a quiz is an excellent way for pupils to design their own project. They can investigate what makes a good quiz app, rewards and sanctions, etc. We start with writing a few questions with text based answers, e.g. “What colour do you get if you mix red and blue?”, ensuring the user will know whether they were right or wrong. We use the “ask” and “answer” blocks and look at checking. We stick to noises and text for rewards and sanctions at first. We discuss spelling mistakes and how that can affect the answer. To do each questions, we need a new set of blocks and the code starts to get very long.

Quiz with variables

When we focus on variables, I take them back to quizzes, looking at a Maths quiz. We start with a number based question, similarly to before. However, we act out two people throwing dice, and then have to multiply them together. We look at creating two varaiables with random numbers from 1-12 and discover how to ask the question using Join. We also look at how to automatically check the answer using the product block eg. “if answer = a * b”. Now we have one automatically created quiz questions and quickly the pupils will have the idea to put it in a loop. Also having done variables, they want to add “score” to the rewards and sanctions.

At this stage there is plenty more to challenge them with. How do you want your quiz to end? They come up with ideas

  • after 10 questions
  • when they have got 10 right
  • when they have got 3 wrong
  • after 60 seconds
  • etc…

Can you make it so that the questions get harder the more they answer (ie increasing the range of the random numbers depending on the score), or the timing to alter the more they answer.


Later on again, we return to quizzes… “Not quizzes again!”

This time the problem or challenge is different. I want to do a capital city quiz. e.g. “What is the capital of France?” How could I do this so that I don’t have to code each question? We act this out. I tell them to write down some questions they would like to use and guess what they do. They make a list!

In Scratch we investigate lists by making one and the code instructions all start to appear. We end up making 2 lists Country and Capital, with the Country and its Capital in the same location in each list. We then decide which instructions are going to be of use – particularly the (item 1 of Country) block.

We then focus on using code for pulling questions from the list, firstly with a fixed question number, then with looping using a random “question” number (up to length of list) and finally looping through the list. Pupils come up with further problems, such as how to ensure the random question doesn’t keep asking questions it has just asked.

Quiz from Lists

The key is that as I introduce my problem and the new coding concepts, the students begin to see how to use them to not only solve the problem I have set, but to solve their own problems and then transfer them to other types of program.

So, in addition to this, as we have met the use of MyBlocks, they investigate how using procedures to do the question asking can simplify the structure.

Yes, in KS2 we do quizzes 3 times! In fact 4, because we make them in Forms too! But I might add, that I am not one of those teachers who sticks to 6 week blocks of teaching. I don’t think that we learn concepts or have to do projects in half-terms.

So what else do you do

Art – stamp pattern, using loops and variables in Scratch

So how else do I stick to just two environments and maintain interest while developing concepts. I do this is different Genres. Phil Bagge’s Code-It Gold materials use Shape (Geometic patterns), Games (2D motion), Apps (e.g. quizzes), Scenes (Animation) and Physical computing. I would add Art and Music to those so that they develop algorithms using the same computational concepts in as wide a context as possible.

All this can be achieved with Scratch and Makecode for MicroBit or similar. There is much to do, and I feel that spending time introducing pupils to too many new environments and interfaces does them a dis-service when they could be concetrating on the coding concepts.

With physical computing, to extend beyond the board itself and give further problem sovling experience, I introduce different outputs and inputs both on the MicroBit and by attaching LEDs, Servos etc to it. There are kits or add-ons that you can buy which work with MakeCode such as Zip Halos and there are floor robots that can be coded too such as my current favourite, the CuteBot Pro.

So what do you teach?

So if I don’t teach ScratchJr, Scratch, Makecode, Minecraft, Blockly, Thunkable, AppCreator, Python etc – what do you teach?

Sequence – Order Matters, Timing matters, Vocabulary Matters, Different Algorithms – Same Outcome?

Repetition – Count Controlled Loops, Inside and outside the loop, Forever loops, Conditional Loops, Nested Loops, Counter in a loop

Selection – If, If – else, If – else if – else by nesting ifs, AND OR, Inequalities < = >

Variables – concept, creation, naming, using in statements, numbers and strings, joining, altering, swapping, comparing, tracing values
Lists – concept, creation, indexing, appending

Procedures – for decomposition in design, as repeated code in nested loops, passing parameters etc.

Notice, this could all be covered in most coding environments, but the focus is on the problem and the algorithm, as well as the programming concepts and constructs needed to solve them. I don’t teach Scratch, just like I don’t teach Python in secondary school, because the language environment is not important. I teach how to design solutions to problems using code.

Treading on Toes?

Quiz using list called from a procedure with a parameter

So my focus is on the concepts taught, not the language environment used. But in giving pupils experiences in all of these areas listed above, am I treading on the toes of senior school colleagues?

There are always more coding challenges to be had. Pupils are not going to run out of tasks to do.

Take the example of the quiz from a list. How would I develop that further? What about creating random multiple choice answers from other answers in the list? What about expanding the list into a 2D list to put in other ‘distractor’ answers. What about randomising the delivery of the distractors in a multiple choice quiz? What about storing student answers, so that it “learns” what wrong answers people often go for? These are all challenges that students can face as they progress through secondary school. Please don’t worry too much about treading on my toes.


Conclusion

So over many years, I have changed.

As the problems develop in complexity, it is the understanding of data strctures & computational concepts that will help students solve these, not the number of different bits of kit we have, or the quantity of different environments that have passed them by.

It is their ability to understand problems, design algorithms and use computational thinking which will help them program solutions. It is meeting this in different genres of problem which will make them experienced solution focused programmers.

So my advice is to delve deeper into a wider range of problems, rather than ask for deeper pockets, for a wider range of kit and software.