Resources for Teaching Kids to Code

written by Thomas Hicks on 2017-10-26

As a homeschooling father I have had the awesome opportunity to be part of my kids' education from 1st through 12th grades (for some reason my kids won't allow me to accompany them to university ... strange). We used a classical approach, thinking about education in three stages - Grammar, Logic, Rhetoric. If I was going to teach traditional and material logic I was certainly going to also teach coding. Having done this now with two children I find myself being asked what resources we used and what resources I could recommend. Limited as my coding background is the DRY (Don't Repeat Yourself) principle is firmly ensconced in my cranium. As such here are the resources I have used to teach coding to my kids (along with a few comments on each).

Rationale

My goal in teaching my girls was to teach them to think programmatically, think like a computer programmer. When I started, I didn't know what I was doing and not all the resources that are available today were available then. This is a listing of the basics of how I would approach teaching coding now (in October, 2017), this will likely change in the future as new resources become available.

Scratch

Developed at MIT the Scratch visual programming language is amazingly useful for teaching programming concepts. With the introduction of Scratch Jr. even students that don't read yet can begin to learn computational thinking. My second daughter started learning Scratch in 7th grade, while in a school in the US. That class wasn't given enough time to really show what 7th graders can do with a language like Scratch and we continued the Scratch course into the 8th grade. By the time she finished she was making her own games with ease and reminding me of forgotten features of the language.

Scratch is a free download from here. There are versions that run on Linux and the other operating systems. At the MIT website you can sign up for an account. This account allows you to save your programs online and share them for others to see and to see other people's programs and even clone them to allow easy modifications.

One problem we had with the Scratch website was running programs from the site. Since we are behind the GFW, I found that I needed a creative way to get to the site in order for programs to run. An alternative to Scratch, that doesn't need any tweaks to run programs on the site is Snap. Snap has all the functionality of Scratch but incorporated a "build your own blocks" feature earlier than Scratch did. This can be very handy when you start to think about object oriented programming - building a block that behaves like an object, etc.

My favorite Scratch book is Super Scratch Programming Adventure!. This book reads like an interactive game, teaching the student the basics of Scratch programming while building a number of games in Scratch.

Another great Scratch book is Learn to Program With Scratch, also from No Starch Press. This book is a little less fun oriented and allows you to do some interesting projects with interaction, shows off some of Scratch's more serious capabilities.

Python

I think if I were doing this all over I would teach one semester of Scratch (but a full course, not a 1 hour a week supplemental course, that would take longer) and then move to Python. By the end of the semester of Scratch the child would have learned loops, conditional execution, handling user input and mouse clicks, math, some basics of animation and color manipulation, etc. By then the transition to Python would be simplified, needing only to teach how Python handles these concepts and giving good projects to keep the student challenged.

I have used several resources for teaching Python. The first we used was Learn Python the Hard Way. This is not a bad introduction to Python but not ideal for the middle school student. The course covers the basics and includes some introduction to object oriented programming (OOP) but I found some of the examples to lack explanation. The author assumes the student will make liberal use of a search engine, behind the GFW the best search engines are blocked so this didn't work well for us.

The book I finally landed on was Bryson Payne's "Teach Your Kids to Code", also published by No Starch Press. This book has an excellent, step by step approach to teaching the basics of Python and ends with building a graphical game using Pygame. I highly recommend it as a good overview course for Python. If the student has had a foundation in computational thinking (via Scratch) then this book should take about a semester.

I have recently become aware of a simplified version of Pygame called Pygame zero. While it doesn't have the functionality of full Pygame, Pygame-zero is a quick way to get in to game programming in Python. The full documentation (here) has a section (1.2) detailing migrating from a Scratch game to Pygame-zero, highlighting the ease of connection between the two.

Other Python resources that have been very helpful for me and my girls include anything by Al Sweigart (Invent Your Own Computer Games with Python, Making Computer Games with Python and Pygame, Hacking Secret Cyphers with Python, and the not to be missed Automate the Boring Stuff with Python). Sweigart's books are all free online but this guy does so much for the community you may want to consider buying one (or more!) of them to support that work.

If you are thinking of doing physical computing or just want to give your child a cheap computer (sometimes peanut butter, cat hair, etc. end up on the computer, why give them an expensive machine?) most introductory books for Raspberry Pi include a solid introduction to Python. If you are going to go the Raspberry Pi route to teach you should keep in mind that Raspbian comes with a Python friendly Minecraft server - your student can use her Python chops to control her character in Minecraft - from teleporting to automating builds, lots to do there and learn coding at the same time.

Physical computing

I should say a word about Arduino and its sister language Processing. These were where we started to learn to code and had great fun with them. My oldest wanted to build a robot so she had to learn to use the Arduino language to write programs to control her bot. She did it but in retrospect I wouldn't use this as an introduction to coding. The language looks a lot like Java and running programs requires uploading to the arduino board, thus development can be slow. Still, it is very satisfying to see your robot dance around the room, avoiding collisions, flashing LEDs, etc.

If I were teaching physical computing today I would do so with a RaspberryPi, Raspbian and RPi.GPIO. You can see my introduction to using the GPIO pins on an RPi in a prior article here.

A word about obtaining resources

I am not made of money but I have a lot of books on programming. How? If you are not familiar with the Humble Bundle it is time to get familiar. From time to time the people at Humble Bundle offer programming book bundles. Often just before summer breaks in the US there will be an introductory programming book bundle - loads of great stuff there, books from Scratch to Python to Javascript to web page building. It is hard to beat a site that lets you pay what you want and add to that they give some of the money to charity - win/win/win!

I hope this has helped you think through some resources for teaching your own child to code, let me know in the comments if you have questions!