Teaching computer coding in schools is becoming ever more popular, from robotics to modifying open source software to writing games and apps. If it’s something you’d like to introduce in your classroom, there are plenty of simple and effective ways to do it, as Jen Zajac and Kristina Hoeppner explain.
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
Software engineer and author Martin Fowler
“First, solve the problem. Then, write the code,” as educator and programmer John Johnson once said. Being a programmer is so much more than sitting in front of a computer all day long and writing lines and lines of code. It means being able to analyse a problem from multiple perspectives, look at the alternatives and make decisions about their viability. In order to solve a problem, you break it down into manageable parts, solve each of these parts and put them all together to have a well-rounded solution. As the New Zealand Curriculum aptly states for the Technology learning area: “quality outcomes result from thinking and practices that are informed, critical, and creative.”
Introducing students to technology and enabling them to explore programming is a great way to involve them in a large aspect of their lives and learn skills they’ll need. Many students use computing devices – from smartphones to tablets – and are consumers online. However, these days it’s very easy to also become a producer of online content and applications. There are many fascinating ways to make the jump from consumer to producer easy, even in the field of programming. By getting involved in programming, students acquire higher-level critical thinking skills, employ problem-solving techniques, transfer knowledge from and to other areas, and also often collaborate with others to achieve a goal.
Scratch and share
Tools like Scratch that use event-driven programming to create stories, visualisations, simulations and experiments are popular, especially with younger students. When students use Scratch, they don’t work alone but share their creations with the community. This encourages feedback, as well as motivates them to do their best, as the entire world can see what they’ve done.
The Scratch community also encourages learning by example and offers the view inside the code for each Scratch creation that has been uploaded. That way, students can retrace the steps the programmer has taken and learn new ways of creating something. The community also offers resources for teachers to get started with Scratch. Adopting these resources for your own classroom allows you to use tried and tested ideas for your own purposes.
What is Scratch?
Developed at MIT, Scratch is a simple programming language that operates using blocks of coded directions. It’s designed with learning and education in mind and specifically aimed at ages 8 to 16.
If you’re thinking about using it, you should check out the Scratch curriculum guide (fizurl.com/scratchguide). It provides an introduction to creative computing with Scratch, through a series of 20 one-hour sessions organised into five topics, and includes session plans, hand-outs, projects, and videos.
Programming with Python
For slightly older students, you might want to move away from introductory teaching languages like Scratch towards something a bit more sophisticated. A common choice for introducing students to ‘real-world’ programming languages is Python. This is a ‘high-level’ language (meaning you don’t have to worry about low-level things like memory management) that’s been around for about 25 years. It’s popular because, unlike many programming languages, it’s very readable, using lots of understandable English words instead of mystifying symbols. It even comes with an embedded version of the old favourite for teaching programming concepts, Turtle.
Modern technology – often written in Python itself – makes applications easier to handle so that teaching programming languages does not require a complicated set-up or superfast computers. A standard computer or even a Raspberry Pi is all you need to start learning or teaching Python.
While Python can be used for many different kinds of applications (websites, command line scripts, executable programs with graphical interfaces), one approach to teaching its use would be to use it for programming games. This obviously has the benefit of being very engaging, and it also introduces students to a number of valuable concepts.
The free online course ‘How to Think Like a Computer Scientist’ provides a great introduction to some of the basic language concepts in Python. It includes interactive code examples that can be run and edited in the browser, so you don’t have to worry about getting Python set up in your school’s computing environment. Another slightly more advanced free tutorial for Python is MIT’s ‘A Gentle Introduction to Programming Using Python’ (fizurl.com/pythonintro).
Trinket and Pygame
While there are many more resources for learning Python, we especially like Trinket (trinket.io). Using Trinket, students can write code and see the result displayed next to it. This makes it possible to manipulate the code and explore the outcomes directly. You as a teacher can create instructions directly on the website, too.
Of course, programming ‘a game’ from scratch would be very daunting but there’s a good open source game programming framework for Python, called Pygame (pygame.org), that’ll give you a lot of the nuts and bolts you need to get started. In addition, there’s an excellent free open source book that’s specifically aimed at kids, with tutorials and examples for Pygame, called ‘Invent Your Own Computer Games with Python’ (inventwithpython.com).
If you’re not yet in the market for teaching programming, you can participate in free online courses that teach computer science principles. The list of MOOCs (Massive Open Online Courses) on programming is growing steadily. Courses for beginners are on offer, as are specialised courses for mobile or game development. They can be a good starting point for your own explorations into programming.
You could also encourage your students to join a local group that offers extra-curricular activities in programming. In the wider Wellington area for example, students can go to the CoderDojo in Porirua (zen.coderdojo.com/dojo/321). In Christchurch, students and mentors work together in the IT HotHouse (ithothouse.com). The idea of an IT HotHouse could be taken to other schools or after-school initiatives, so that one could be set up near you.
Open Source Academy
Catalyst has been offering a summer Open Source Academy for the last four years. Next January will be the fifth anniversary of this two-week summer programme, when we open our doors to a new group of students (Years 11 to 13) from across the country. The Academy gives a taste of real open source development through a combination of classroom sessions and hands-on project work. The aim is to quickly get them to the point where they can contribute to a real software project that is used by thousands of people around the world.
Students who join the Academy cite the participation in an open source project and being able to leave their mark on software that’s used worldwide as a big motivator for spending two weeks in summer in our Wellington office with other students and mentors. By organising the Academy, Catalyst hopes to show young technologists how to participate in open source communities and help them explore their passion for IT through freely available open source tools – as well as attract more talented New Zealanders into the IT profession.
Academy for teachers?
Catalyst is considering a training programme for teachers to learn about computer coding. Contact firstname.lastname@example.org if you’d like to express your interest in an Academy for teachers or for more information on the student Open Source Academy:
Learning about robotics
In addition to the yearly two-week Academy, Catalyst has started offering shorter courses for the winter holidays. This year, it will be running the second Arduino Academy, which introduces students to micro-controllers working with the popular Arduino platform. Also being planned is a ‘Learning about robotics’ course to introduce students to tools used for robotics.
Offering your students the opportunity to explore programming while at school will challenge a range of skills and provide an engaging setting for learning. In a wider sense, you’ll also be opening them up to perhaps considering job opportunities in computer science or the wider field of Information and Communication Technology as a career. Besides that, they’ll be able to enjoy creating cool things for themselves or their friends.
When asked why people choose to write code either as a hobby or professionally, the following are some typical answers:
Being able to make changes to games or programs, so they work exactly the way you want them to work;
Seeing other people create cool things and wanting to be able to do the same; and
Being able to make work flows more efficient through automation.
Programming is a great way to move from being a consumer to becoming a producer and create awesome things to share with friends, at school or with the entire world. Join in and get started.
Jen Zajac and Kristina Hoeppner work for Catalyst.