Teaching my nephew how to code – the basics.

This isn’t a serious post. Just a personal story/recap of what I’m doing to teach my 11yo nephew the basics.

We started with Scratch last year, but both of us got tired of that environment pretty soon. We had a ton of fun making little games, but both of us are low on patience, so any time looking around trying to discover the tool’s weirdness just resulted in two very frustrated people :).

A month ago he reached out to code again, so I decided to throw him into “real world” tools. I think using tools that felt useful and real was key to keeping me engaged as a young dev, so I decided to try that with him, too. Given that he asks for a new lesson every weekend now, I think my plan is working 🙂

So far, he’s been digging into HTML, CSS, and JavaScript. We spend most of the time in JavaScript, but I always have small snippets of CSS around for when I see his energy levels go down — the quick dopamine hit from coding a fun animation is a great way to cut a dense lesson on race conditions.

We have only covered the most basic concepts, but I’ve tried to make it fun. He’s learned about `const`, `let`, simple CSS transitions, how JavaScript’s `console`, `alert` and `prompt` work, and how to pull that together to make some interactive things happen.

As I write this, he’s building his first sum only calculator with a `prompt` and `alert` based UI. In between new concepts, I refresh old ones. “Do you remember why that happens?”, and “What will happen when this code runs?” are my go-to questions; I want him to build good instincts for debugging, so I never stop him if he’s heading towards a bug. I’d rather use the chance to teach him how to solve it.

We’ve dug around in the browser’s debugger, using breakpoints and inspect to learn what our code is doing. I think all new devs should be taught how to solve their own problems, and teaching him about debugging tools is part of that.

I’ve made sure he learns how to read error messages, too. If you don’t know how to read an error message, debugging feels mysterious. So he has to learn, even if he doesn’t like reading.

As we write simple scripts, he learns about code readability, comments, and documentation. I try to avoid lectures by taking a page from my onboarding habits and meshing together lessons with hands on work. When I have validation that he’s getting the concepts, I introduce new levels of depth.

Today he asked for homework again. I count that as evidence that he’s hooked 🙂

If you’ve taught kids how to code and have any advice, please let me know!. I am sure the honeymoon is gonna be over real soon and I’ll need some actual plans to keep the momentum going.

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s