How to teach students the language of coding
Recent government initiatives have placed increased emphasis on schools, both primary and secondary, to produce computer programmers capable of fulfilling the required jobs of the future. However, if educators have little or no programming background this can be a daunting prospect.
This needn’t be the case. I believe that anyone can confidently teach the language of coding. It doesn’t require you to learn a specific programming language (but will make learning one much easier), just the fundamental principles which underpin coding. These are my recommendations on how to teach students the language of coding.
Coding is all about creating logical solutions to problems. This skill can be developed through teaching the skill of computational thinking, a technique used to solve problems logically. Within the computational thinking process, the written code, or algorithm, is the final part of the computational thinking process. However computational thinking is not simply confined to the realms of computer science. It is a problem solving technique which can be applied to any subject, or any problem, which is why I believe anyone can teach the concept. Below I will explain the key concepts of computational thinking and provide examples of how it can be taught without the use of computers. Computational thinking contains four essential elements;
1. Decomposition - this is the process of breaking the problem down into smaller, more manageable parts. For example, if you are going to go on holiday, you need to break down the problem. Where do you want to go? What type of holiday do you want? What accommodation do you want? When will you go? How will you get there? Drive? Fly? Boat? What do you want to do when you get there? Is your passport up to date? All these smaller parts are easier to tackle rather than taking on problem as a whole. When writing code, you are writing a solution to a given problem. Within computer coding, the problem will often be complex. It is always recommended to break down the problem into smaller parts.
A great way of teaching the skill of decomposition is by getting students to think about how to break down real world problems, for example, when asked about what ingredients are required to make a cheese and ham sandwich, students may respond with ‘bread, cheese, ham, butter, pickle, etc.’. This practice encourages students to break down a problem into smaller, more manageable parts. You may also get students to consider what equipment and utensils are needed to make the sandwich. Other, more complex problems may include what is involved in negotiating a typical day at school, arrange an activity for your friends or organising a birthday party.
2. Abstraction - this is the process of identifying the important components within the problems identified. Continuing the holiday example, you could identify the key components of organising a holiday into methods of travel, accommodation, activities and packing. Abstraction may take many forms. If you consider the abstract art of Van Gough, his paintings were his own interpretation of the key elements of what he saw. An architect may design a model of the building to be created, an engineer may create a prototype before creating the real product. Within computing, once the problem has been decomposed, the important parts can be abstracted. This could be done by making a flowchart overview, identifying the key tasks, decisions and flow.
There are many fun ways of teaching decomposition within the classroom, for example, the board game Articulate is all about the ability to abstract key details. For example, when attempting to describe an animal, students will need to consider all the key features that others may recognise, for example, a tiger is a large cat with black stripes. Gareth Bale is a Welsh International footballer who wears the number 11 and plays for Real Madrid. By filtering the key information, students are using the skill of abstraction. Writing a synopsis of the plot of a play, film, or book is another way of developing abstraction skills, identifying the key events. Getting students to coach a sporting skill to their peers is another method of developing abstraction. The student must consider the key elements of the skill and provide a demonstration of how they are performed. LEGO® Education resources can be used to develop abstraction skills. Asking students to recreate a famous landmark will get them to consider the important elements that make up the landmark. For example, when studying France, students could create a LEGO version of the Eifel tower.
3. Pattern recognition - involves the identification of similarities or sequences within the problem. Within this section you may consider past solutions of a similar nature, or recurring parts within the broken down problem. Within the holiday example, you may want to consider favourite holiday destinations as well as locations you didn’t enjoy. All these past experiences will aid you in making a decision on where to go. Within computing, programmers will analyse the decomposed problems and consider if previous programming techniques are applicable to the proposed solution. Pattern recognition can also be used to improve coding efficiency; programmers may identify where coding can be repeated within the solution to save time.
Pattern recognition can be delivered in many ways within school, for example, when reviewing the performance of a sports team, students can be encouraged to discuss what tactics went well and which did not. This may then influence how the team play in future games. Games such as spot the difference, Sudoku and word searches all encourage the development of pattern recognition as does pattern based IQ tests. In maths, sequences such as times tables and the Fibonacci series all essentially require the learning of patterns. Code breaking cypher based activities are also great for developing this skill.
4. Algorithmic design - is essentially the creation of step by step instructions to solve the given problem. The nature of the written solution can be adapted depending on the context, or subject of the given problem. For example, if you are planning a road trip, you may want to create a travel pack to include all required information such as activity and accommodation bookings and a map. In an alternative example, a storyboard would be a suitable set of instructions for the creation of an animation, while a recipe would be ideal within a food technology class. When writing an algorithm, programmers will create a solution using either a flowchart or pseudo code, a form of shorthand written language. The solution will not be specific to a programming language, rather, the aim is that it is a set of instructions that can be interpreted and transferable.
To develop the concepts of algorithmic design, it is important to conduct the writing of instructions after considering the first three components of computational thinking; decomposition, abstraction and pattern recognition. From here, the problem has been broken down and thoroughly considered prior to writing a solution to solve it. Writing algorithms can be done in a variety of ways. A fun introduction is to play robot and programmers where students are placed into pairs and given the role of either the robot who must follow the instructions or the programmer who provides them. Get the programmers to guide their robots from one point to another, making sure the robot follows the programmer’s instructions precisely, even if they are wrong. This teaches students the importance of providing accurate instructions. The roles of robots and programmers can be repeated within the exercise of cup stacking, where the programmer writes a series of symbols (e.g. arrows representing the robots hand movements up, down, left and right) for the robot to interpret in order to create a cup stack structure.
The concepts of pseudo code can be practiced in many ways. As stated above, writing a sequence of cooking instructions in the correct order and writing out the steps used to conduct an experiment are both great ways of developing this skill.
Flow chart algorithms can be used to create a sequence of instructions which include different pathways dependant on the outcome of specific events. A fun way of developing flowchart creation skills is by creating flowcharts to explain classic games such as heads or tails, rock paper scissor or snap. Creating a family tree is a great way of introducing students to sequencing flowcharts. Students can also write flowcharts for things such as negotiating a day at school, deciding whether it is time to get up in the morning or not, how to cross the road or any other scenario which may have different outcomes depending on the decisions made.
Algorithmic design doesn’t necessarily require the use of flowcharts or pseudo code. The concept can be developed in many ways. For example, students can create a storyboard sequence for an animation or filmed performance, choreograph a dance routine, create a timeline of events within a history lesson, create a paint by numbers image, draw a diagram to represent the water cycle, plan a route from point A to Point B on a map, write a piece of music or write a fitness training programme. All these activities involve the creation of a sequence of ordered step by step instructions in order to solve a given problem.
Teaching the language of coding develops more than just computer programmers. It creates independent problem solvers who are capable of creating logical solutions to problems through computational thinking. I’m sure you will enjoy the journey too!
Carl Wyatt is a computing teacher in a secondary school in Bristol.