Live data from Hacker News

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

news.ycombinator.com

11–20 of 30 posts

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

#11
What got me into coding as a kid was modding games that I was already playing. Changing variables in GORILLA.BAS so they threw bananas at a faster speed. Messing with sprite files in Command and Conquer so I could design my own infantrymen. Anything where my changes gave me instant feedback was exhilarating. I think Minecraft and Roblox are the analogs today.

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

#12

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 i…

Agree. I learned on C++, but like Python. Make console games. Like how you guess a number from 1-100 and the game tells you higher or lower. Then tell him that you can guess it in just 7 tries or less (always pick the middle). The cool and potentially useful math tricks were interesting.

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

#13
A lot of people will say "teach concepts". Concepts are necessary, and learning languages like Scratch are good for revealing them.

On the other hand, reverse engineering is the "fast path" to grasp most any technical study in depth, programming included. Reversing only hits its limits when new fundamental concepts need to be introduced.

It doesn't have to be reversing from final results; studying and modifying pedagogical source code is fine and often better than "real-world" in the early going(since the real stuff is always cluttered with concepts). What you should teach in this regard is the technique you would use to study the code in depth: for example, how to "run a CPU" in your head, which can be demonstrated by stepping through with a debugger. Or using the printf statement to create a basic logging system. And the kinds of common data structures. If you give a kid an understanding of structs, arrays, strings, and event callbacks, and some rudimentary debugging knowledge, then point them at code to study, maybe with some guidance the first few times, they can self-learn a lot of things from there.

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

#14
What's really important for a newcomer (and even more for a 9 year old) is to be motivating and rewarding. For most kids, modding their favorite game or drawing a few lines on a canvas would be fine.

The programming language doesn't matter, but lua for roblox or java for minecraft would be a good fit.

Background concepts like how does the CPU work, what's an OS, what's an architecture aren't important for a kid. If he wants to continue programming as a career, he can learn them, but they are not important to get started and will probably lose the motivation.

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

#15
post #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 programmin…

How do you encourage your son to learn programming

Unnecessary. A nine-year-old boy is as likely to refuse influence over Roblox as a junkie would heroin.

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

#16
post #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://karel19…

A modern version using Python is https://reeborg.ca/reeborg.html

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

#18
Going through this now with a very bright group of 4 to 6 year old cousins. Code.org, then any blockly lang capable robot. $50-$150 on Amazon. Dash robot has has great and easy apps already written to use it. Great to get a 5 year old into it. 9 years old ? Go with the build it yourself dump truck and backhoe robot and save $100. Good luck

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

#19

There's this toy for the iPad. Don't remember what it's called at the moment. think it's called the Osmo. Seems like a good fit for children

Yes, Osmo has been around for many years and seem to be a playful way to get into some simple logic that can be carried over to computer programming / extended on.
Post reply on HN