Cover image for The Best Way to Teach Students About AI Is to Build Something Together

The Best Way to Teach Students About AI Is to Build Something Together

4 min read

The other week, I had a great time talking with a classroom of grade 4 and 5 students about my work as a software developer, how I got into the field, and what it’s like to work with AI.

Thanks to Sinead and the school for hosting me. I had a great time telling the kids about my job, the kinds of things they can build, the places I’ve worked, and what classes at school helped me get there. Even mentioning I wasn’t that great at math sparked some “whoas” from the crowd.

I was also able to show off some of the amazing tools that we have these days, like Claude Code and Google Gemini. These kinds of tools can basically build apps, websites, or games for anyone just from the browser. The students couldn’t access Claude Code or Google Gemini on their school-provided Chromebooks, so I demonstrated what the tools could do by projecting my screen for all to see. A few of the kids had already tried Gemini at home, which was quite cool given their age. Sounds like me when I was young!

Several great questions initially caught me off guard, including What are tokens? and How long has AI been around for? They showed that even young students are already experiencing this generational shift in technology.

The main exercise that I ran with the students was the idea of building a 2D racing game using Claude Code. I shared my terminal with Claude Code open, explained how this tool takes natural human language and turns it into code, and got the initial 2D racing game working. We raced a lap and everyone was pumped that I came in first place against the dumb bot drivers.

Let’s get creative now. All the students then worked in small groups to come up with ideas that they wanted to add to the game. After the brainstorming, each of them would tell me what their idea was, and then I would prompt Claude Code to add that functionality. We added points, different levels, and the ability to customize the colour of your car, and we changed the gravity to make the driving more difficult. With each new iteration of the game, we’d race and see how well the new features worked. Most of it was spot-on, but we did find a few bugs. This proved useful for explaining what a bug is and showing that AI doesn’t always get things right all the time, even with code.

Using Claude Code meant that the resulting HTML 2D racing game was way more polished than anything coming from Google Gemini’s Canvas feature. After a few rounds of reprompting, Gemini dropped large sections of code and broke the game.

It was also useful to point out that, yes, you still need to understand what the actual code means and does. We went into the code itself, inventoried the game’s main functions and variables, and manually tweaked the gravity constant to affect the feel of the racing.

I’m glad the kids loved this exercise and had a fun time. I shared the resulting single-page HTML game with their teacher, and I heard that many of the students played the game in their own homes that evening.

My own aha moment

One of the stories I shared with the students was a viral moment during my grade 10 Business and Programming class. My teacher, Mr. Byers, was great. He knew I was already advanced at programming for my age, so I would get all the work done and then put most of my time into building something really cool for the end-of-term project.

Networking was and still is a fascinating concept to me: the ability to connect multiple computers together brings a whole new level of interaction between humans and technology. I ended up creating a networked chat program, basically like a dumbed-down version of MSN Messenger or Facebook Messenger, where everyone would talk in one big group chat.

There was one day when the chat program was looking slick and working well enough that I started sharing it with everyone in class. Everyone quickly became distracted by being able to message with one another using whatever name they decided to give themselves. It was an instant hit as fellow students laughed at the silly things being said. The chat ran for about 30 minutes before crashing, probably because of a missed exception handler or reconnection bug that I didn’t know how to diagnose at the time.

Our teacher didn’t mind the entire class being distracted because it was just one day. I thank him for his leniency there.

That’s one of my favourite early memories of building something that people enjoyed.