Thinking like a computer
One of the hardest concepts that we need to teach children during computing is that computers are incredibly stupid devices. Yes, they can compute increasingly more complex calculations quicker and more efficiently than a human can, but they need to be shown how to achieve it in the first place. Computers will ONLY do what they have been instructed to do via a piece of code.
Children expect the computer to know the expected outcome when they start to code and become frustrated when it does not work. They cannot understand why a missing space within the syntax of code can cause it to be misinterpreted. Humans are very adept in interpreting and extrapolating meaning from mistake-ridden sentences.
Fur exarmple yoo can oonderstaynd wat theese is ment too sey, but a computer would struggle. In fact it has a string of red lines under it on my screen telling me just that! This is the hardest concept that children have to grasp within computing. The only way to achieve this is to break it back down to first concepts for them.
Think about making a sandwich. You could make one with ease, but have you ever stopped to think about how complex it actually is as a process? Firstly, you need to collect all the ingredients and utensils. You then need to complete the steps in the correct order to make the sandwich. You would also need precise instructions to explain HOW to complete each step; otherwise, you may end up with butter on the outside of the bread. A hilarious video of this can be seen at https://www.youtube.com/watch?v=leBEFaVHllE
In this sense, a recipe is a form of algorithm. A set of steps to follow to achieve a goal. If you miss out a step, you could be in all sorts of trouble. This is why careful planning and debugging is essential to achieving the desired goal.
Physical modelling of the need for precise instructions is a fantastic way of introducing the idea of coding to children. I have used children as human floor turtles before, only able to move as and when instructed by the class. The hilarity when trying to navigate a maze shows them that debugging is an essential process.
Silliness aside, the children in being ‘the computer’ are learning the need for precise instructions given in the correct order. They will also begin to see the need for conciseness in their instructions. Wasted code takes up space and can make their programs inefficient..
Coding is what happens between the input and the output. Without it the two can never be connected. Thinking like a computer helps us to predict what a piece of code will do. Children can begin to look at a section of code written by another person. As their understanding grows, they will be able to decompose the purpose and the outcomes of the code. They will be able to break it down in to smaller sections to improve, debug or replicate it. Through creating code, children demonstrate their understanding of the meaning behind it, in the same way children demonstrate their knowledge of grammar through their sentence writing.
In school, we are preparing children for computational thinking. The ability to decompose; use logic, abstraction and prediction. To spot patterns and evaluate what we have created. Children can think their coding through and create with a purpose. They can ask what if questions: What if I change this value? What if I use a repeat?
In doing so they will be more productive when beginning to write their code with the need for debugging reduced.
Images: Karola Riegla & Barefoot/CAS
Computational thinking can be applied to all levels of coding whether block based programming at primary; text based programming at secondary or even in a commercial setting. These skills are universal.
A testament to this is a former acquaintance of mine who worked for a large web design company. He was creating a website for a commercial client purely in code. He could see and explain how the finished website would look without having seen it, just from the code. He could apply his knowledge of the code to think like a computer and predict the outcome.
While I certainly do not expect to be able to write a website in notepad, thinking like a computer will help them to be accurate and precise when coding. This is expected in other aspects of the school curriculum, most notably punctuation and grammar, so why shouldn’t we expect it in computing.
Knowing what a piece of code will achieve will allow them to create programs that are more sophisticated, more quickly, which is after all the purpose of the new computing curriculum. The Government wants us to equip the children with the skills that industry is crying out for.