Ask HN: Best resources for teaching my 8 year old to code

23 points by cdnsteve ↗ HN
Looking for feedback for resources and ideas on how to ease my son into coding. He loves Minecraft and has done hour of code. Now he's excited to build his own website. Any kid friendly options out there that cater to this?

I was thinking of setting up a Node server with hot reload so he can make changes and instantly see them while we go over some of the basics of HTML as a starting point, create a few pages and link them to each other. Having an immediate feedback loop will be important.

22 comments

[ 2.8 ms ] story [ 63.8 ms ] thread
Can't you skip the Node server and have him just use index.html and refresh? That way he won't rely on you to set it up. Alternatively, there are many services like Glitch that probably give you auto-reloading.
Have him work through the book Head First HTML and CSS.

Develop locally save, refresh the browser to view (Checkout Laravel Valet for local web server on OSX).

After that walk through registering a domain and basic hosting, uploading via FTP. Just so he knows how it works.

After that move over to storing things in a repo and deploying.

I agree with this simplistic approach, naturally I'm sure like many of us did when we were learning start to ask the questions "I'm doing this over and over again which seems really redundant, not secure, prone to human errors, etc, there must be a better a way!" and at that time you can happily explain to him that for the majority of the stack there is usually a solution that someone has come up with that solves those pain points.
y, I would recommend doing things the 'hard way' first, learning the ropes how to do things at a basic level.

Then reveal the magic and better practices.

Next learn to roll their own web app with authentication, etc.

Then show them a framework that takes care of the 'magic' behind the scenes.

live.js and any webserver that answers HEAD requests would accomplish with fewer moving parts.
For web, try creating a react site. I'm not suggesting you teach him react, but the environment is set up for you already and auto refreshes every time you save.

Another good project, if you plan to go from html to coding, is https://microbit.org

Sounds like you're trying to work backwards from your production setup into a "toy" one. Honestly, HMR is a double-edged sword. Your son is much more likely to understand the fundamental HTTP request lifecycle if he needs to manually refresh, than if his environment does magical web-socket-based code rebinding.

I'd suggest going the opposite way: start off with vanilla local HTML files. At the very start, he's going to have his hands full with HTML and CSS, then eventually JS and dev tools. It will make way more sense for him down the road if you introduce templating/routing after he realizes the tediousness of copying and pasting layout changes across multiple HTML files.

For introducing server-side things, I'd suggest something web-centric like PHP. It may not be sexy, but it does two important things: 1) it won't bog him down as much as Node with configuration/plumbing stuff like setting up a database or adding static asset middleware, and 2) it will expand your son's horizon from just-javascript-development to polyglot development.

I would start with something less abstract, more concrete to start. I have a 4 year old who picked up the ability to program this simple mouse to navigate the maze and find the cheese. If I try to go too abstract, you can see the eyes glazing over.

I was at a steam fair last weekend, and they had the OhBot, a programmable robot face, on display. It is programmed with what appeared to be a version of Scratch. You could control the head, mouth, and eyes with the track pad and keys. Kids were really into that and there was quite a line at that table.

Thinkfun also has a good board game to teach programming logic called Code Master Programming Logic Game.

If you really do want to go a more abstract route, I would start with the Python for Kids book by Jason Briggs. Once he gets through that, get the Python Crash Course next and work through the 3 problems in that book. It has one where you make a Django app with a user login.

I would say start with Scratch (https://scratch.mit.edu/)

I have tried to teach my kids "programming" but it isn't until they are invested for their own reasons that they really care to learn this stuff. We let my oldest just look around at projects on scratch so he could find things HE was interested in (minecraft, gravity falls, etc) and then he was interested enough to start copying and manipulating projects (we didn't even show him how to do it, he just figured it out). Now he has posted his own first project and had the unique feeling of "shipping" something. I think that "shipping" feeling is the quick feedback kids need to get and stay engaged.

I've been compiling Scratch books and here are my (and my kids') favorites:

- Coding for beginners using Scratch (Usborne)

- Code Your Own Games!: 20 Games to Create with Scratch by Max Wainewright

- Super Scratch Programming Adventure! by The LEAD Project

- Coding Projects in Scratch by Jon Woodcock

- Scratch Programming Playground by Al Sweigart

The list above is roughly in order of difficulty. The first two books have spiral binding so they sit flat on the table. I found this to be immensely helpful when my kids first started to use the computer / do Scratch. They could focus on using the mouse and tap-tap-tap typing on the keyboard without losing the page.

(edited for formatting)

Awesome, thanks for sharing this!
Start with HTML, then CSS. If he wants to build his own website, let him do that. Walk him through making a basic page right away (static, unstyled HTML), have him link some together, etc. He will be motivated to learn new tricks as he seeks to improve the pages.

No need to learn javascript or something else at this point. if it's not immediately related to what he wants to do he'll get bored.

You have the right idea with feedback loop. Kids can teach themselves, given the resources. Your main job is to nurture his motivation.

Source: I taught music lessons to ages 7+, for over a decade.

I found the visual programming provided by the BBC micro:bit very approachable. Try it in the online simulator, then get a board for $10.

This provides a drag and drop interface for loops and variables and makes LEDs blink nicely.

Also makes it super easy to switch to the js or python representation of the visual program.

Tried it with a 7 year old. She got it I think.

Scratch is definitely the way to go to understand programming concepts. It's drag and drop so no need to remember arcane syntax rules, but it still lets you build loops, conditionals, variables, subroutines and all that jazz.

If you want to teach simple website creation with real code, then just use CodePen. By default, you get 4 tabs for HTML, CSS, JavaScript and preview. Absolute no need to introduce a server.

I just bought the Programmable Boards offer in Humble Bundle... for my 5 years old son.

I also have an Construct2 license liying around to teach my nephew how to code with Games!!. Take a look at it: scirra.com/construct2

I would say python. It's written like English and it's pretty fun .
My 2 cents: ScratchJr worked for my daughters at an earlier age and not so interested in programming. IMHO if you can use the capabilities of MIT Full Scratch you can start programming in a language like Python.

Also, my daughters started playing with Alice3D objects at a very early stage and I was in charge of scripting the objects. At 8-9 year old they can script the objects by themselves.

Another toy is the Lego Mindstorms where you can build the robot (I think it is complicate for young kids) and they can script the action in the iOS app.