In computer science, it seems that everybody is focusing on the programming language that the teacher or department chooses – be it Java, C#, Ruby or Python. Deciding upon a programming language to teach is only one step, however. The next question is – how do we gain confidence within ourselves to learn this language, in order to field off-key questions about it during a rainy Wednesday afternoon Year 9 class? Off-key questions, of course, are usually the very best kinds of questions a student can ask, and are to be encouraged. However, a teacher needs to be at least partially confident that they understand what the student is asking, can contextualise it, and can give a response which makes sense, beyond asking them to Google the answer.
Learning to program a computer takes time for an adult, because it is a language, similar in many ways to a foreign language. Such as Spanish. Or Swahili. The best answer is to immerse yourself in it. CPD courses can be very useful, but nothing tops regular practice and overcoming teeth-gnashing problems involving colons and brackets when learning a programming language. Finding the time to do this is very difficult, and it can be lonely and frustrating; this is why communities, such as those found within Tes, are so important. The bottom line is – thinking “growth mindset” here, or disequilibrium, or the zone of proximal development (ZPD), or a host of other terms about learning from failure from a variety of pedagogies – you need to go through the frustration of failure in order to really learn a programming language, and that takes time. Months, at least.
Putting programming in its proper place
Programming also needs to be put into its proper place. Students should be learning about at least basic binary/denary conversion. About how images and sound and video files are comprised of binary 1s and 0s in various forms. About principles of logic. About transmission of data across networks, and encrypting that data. And about how to design, plan, implement, test, reflect and then redesign, reimplement and retest software properly. In other words, they should be taught the principles of computational thinking, including:
- Logical reasoning
- Pattern recognition
- Data representation
Well. They can, I am sure, be very interesting in their own right. Sometimes. However, around these principles, we should also look to bring in concepts such as security and ethics, or privacy and copyright and malware and, if we are really thinking ahead, about artificial intelligence and lattice encryption and quantum bits. So learning about strings or tuples or procedures in Python needs to be very much slotted into this bigger picture.
Finally, the teaching of computer programming needs to bear in mind Dylan Wiliam’s notion that what matters most is how things are taught, rather than what is taught. This quote from Embedded Formative Assessment (2011) sums it up perfectly:“A bad curriculum well-taught is invariably a better experience for students than a good curriculum badly taught: pedagogy trumps curriculum. Or, more precisely, pedagogy is curriculum, because what matters is how things are taught, rather than what is taught.”
The aim, of course, is to nail both pedagogy and curriculum in one, but I am the first to admit that a good deal of computer programming concepts are, at best, dry as a bone, and sometimes infuriatingly obtuse. Recently I taught a subsection of string manipulation involving boolean operators, and it took me a few stabs before I managed to convince my students of the need for them. Once convinced, they are now using them left, right and centre. I cannot move for boolean operators. That is true.
So if we begin with teaching the most basic concepts of programming in Python – found in this “one-minute read” – then we could demonstrate that Python, like all programming languages, is essentially a glorified calculator, rapidly shifting numbers and data around. We could ask students to type in a variety of calculations, and compare this process to mental maths, and then to pen and paper, and perhaps then to a spreadsheet. We could explain to them that Python has a feature known as the “shell”, which enables the programmer to quickly test out and run code, and we could ask them to think of better ways to run code, and better ways to store data. We could also spin amusing jokes about how Python turtles are comfortable in their own shell, or why ants in an IF statement are big. (Hint – elif.)
We should also encourage the students to be as utterly creative in their programming as possible. There are so very many ways to program a computer to do something. Given the same brief, students can easily come up with four or five different ways of fulfilling it. Some ways will be more elegant, concise and Pythonic than others, but all of them have their place.
As ever, please get in touch with me here or via @Steve_T_online to share expertise, questions and woes.
Stephen Trask is an Apple Distinguished Educator – one of only 2,500 educationalists globally who have been assigned this status. He oversees technology and is the data-protection officer at a British international school in Rome, and has previously worked in the UK, Asia and the Middle East. He tweets at @Steve_T_online