Live data from Hacker News

Ask HN: How do you teach 9-year old to code?

news.ycombinator.com

1–10 of 30 posts

Ask HN: How do you teach 9-year old to code?

#1
Yesterday my son (will be 9-year old in a couple of months) asked if I can teach him to code. Although I am a software engineer, I never thought about that.

My question is: If I do, what language should I teach my son at first? Currently I'm mostly familiar with Rust, and a little Python. I used to write C for 10 years and Java for 3 years. I also use Objective-C. I think, as common sense, I should use the language I am mostly familiar with (Rust), but I doubt that's a good idea for 9-year old.

Re: Ask HN: How do you teach 9-year old to code?

#5
post #2

I would definitely start with a block-based programming environment just to get started with general concepts like if-statements, loops, and whatnot.

Yeah, I second this. Something like Scratch.

Then move on to an easy to learn language such as Python probably. Simple, no fuss.

Re: Ask HN: How do you teach 9-year old to code?

#6
Get him started on something that focuses solely on the programming concepts and the way of thinking without any unnecessary noise (pointers, lifetimes etc.). When I was starting out I attended a programming club/group and we were using Robot Karel. It's a little programming environment where you control a robot and walk him through obstacles.

https://en.wikipedia.org/wiki/Karel_(programming_language)

https://karel1981.com/

Re: Ask HN: How do you teach 9-year old to code?

#8

Given its loosy-goosiness and ubiquity in gaming (Roblox), Lua is the inarguable answer.

My son is 10, he started with scratch when he was about 6, moved to Lua/Roblox a couple of years ago and has since picked up C#/Unity. He definitely got the fundamentals of programming down by working with Lua. Key to his intrinsic drive was being able to code things he loved (games).

Re: Ask HN: How do you teach 9-year old to code?

#9
Reframe your approach: How do you encourage your son to learn programming and stay curious and motivated? You can't teach anyone unless they have the motivation and interest to learn. Kids have lots of natural curiosity so you need to take advantage of that. You need to keep the interest going with challenges and successes.

Do the simplest possible thing to get your son interested in anything remotely like programming. The other comments have some good suggestions. With some success at simple things like animated robots and Minecraft and Mindstorms your son may decide to keep digging into programming.

Re: Ask HN: How do you teach 9-year old to code?

#10
I think python is the best way in. I was a few years older than that but not much when I started learning it.

It doesn't have very much syntax but you can still do stuff with it. A good place to start might be to find a library for something he likes. Maybe a game or some other topic he is into.

I've been using this video to teach someone. We watch for a while and then pause and code on my PC. I honestly don't know if it's a very good method or even a very good video. Results have been good so far though.

https://youtube.com/watch?v=rfscVS0vtbw

Post reply on HN