Teaching my 11-Year-Old Daughter to Program (in Ruby)

This is installment #1 in a series of posts I will write about teaching my 11-almost-12-year-old daughter to program in Ruby.

In the last year I taught my daughter Rosey, who is 11 years old and in sixth grade, the basics of HTML. With help and training from me she made a few web pages with her own drawings, including some clever puzzles. We hand-coded all the pages instead of generating them with a drag-and-drop tool. That was her choice. (Hooray!)

She came away knowing some HTML. She knows it well enough to give a bit of an explanation to her friends, which I think is awesome. I tried to teach her a bit of CSS and JavaScript too. She may have had an inkling of how they work, but I didn’t do a very good job on those parts. I think it was mainly because I didn’t have a structured way to teach them. I admit I was pretty much all over the map. HTML was easy to teach tag by tag–start with <html>, <body>, <p>, and <img>. But with JavaScript to do anything useful on a website you have to go quickly past the basics and understand functions, the DOM, and more. I ended up writing the JavaScript myself and hoping she’d at least know it exists so she could come back some day.

Now it’s a new year, and next week she’ll turn 12. I asked her if she’d like to learn to program in a language that can actually make things happen instead of just show things on a page. Somehow I must have used just the right combination of excitement and pleading, because she said yes.

Very cool. I get to teach my daughter to write software! I’ve been waiting for this day for a long time. Almost 12 years.

She already knows a couple of boys her age who have started learning to program but most of the boys have not. I’m excited that she will be ahead of a lot of the boys, since I hear one reason girls are sometimes behind in learning computer stuff is the intimidation factor: they take a class and see that most of the boys have already learned a lot of it on their own, so the girls feel like they’ll never catch up. I totally get that, and want to prevent it.

I Like Stuff that’s Ruby

Decision #1: what language to teach? I wanted to teach an interpreted language because interactive interpreters make learning easier. I primarily considered JavaScript and Ruby. I think they’re both great choices because (a) they’re both interpreted, (b) neither requires an immediate understanding of object-orientation, (c) I know them both really well and love them both, and (d) they’re actually useful.

I also considered “kid” languages like Scratch or Logo. But I’ve tried Scratch and honestly I didn’t get it. If I don’t get it, how am I going to teach it? I did learn Logo years ago and it was fun. But I was more excited about teaching JavaScript or Ruby.

A couple years ago while browsing the Programming section of Borders Books in Palo Alto I noticed Chris Pine’s book, Learn to Program, and wondered if it would be good for a middle-schooler. I read more about it, and found a review titled “Great for Kids.” The author is using Learn to Program to teach their 8-year-old daughter and loves it. Plus I learned that the author actually teaches programming to kids my daughter’s age. That’s good enough for me! So I got the book and will start teaching her to program.

(By the way, if you haven’t been to Border’s on University Ave. in Palo Alto, do yourself a favor and go inside. It’s cool. It was a beautiful, classic movie theater called The Varsity when I moved to downtown Palo Alto in 1988. Later they converted it to a bookstore but they kept the marquee.)

Lesson 1

So Today I went out and picked up the book. No way could I wait for an Amazon shipment. Then I read the Preface, Introduction, and Chapter 1. Then I asked her to start with the Preface and read for 20 minutes or so and stop wherever she is, or to finish Chapter 1 if she wants. She ended up stopping at the same spot as me. Tomorrow we’ll go over Chapter 1 together. It’s mostly just about installing Ruby and a text editor. But I’ll also go over some of the high-level concepts I remember being incredibly confusing to me when I first learned to program. Specifically:

  • When I type a line of code into the computer, how should I think of this in comparison with an English sentence? Is it Declarative? Imperative? Something else? (Fortunately I think she has learned these terms in school. If she hasn’t, I can quickly describe the differences.) I think for a beginner the easiest explanation is that all lines of code are imperative. More specifically, you are telling the computer what to do. When you say “print 3” it’s like telling someone else–someone who always follows orders–to print the number 3 on a piece of paper. Of course some computer programming statements are more like declarative, interrogative, or conditional statements. But the first thing a beginner learns is the imperatives like “print.” (I peeked ahead at Chapter 2 and it starts with “puts 1+2”.)
  • What is the difference between RAM and the hard disk? How should I think of “saving” or “opening” a file? My daughter has saved documents before but I don’t think she quite groks RAM vs. disk yet.

Expectations

I enter this adventure with excitement and high hopes but also realistic expectations. She may get bored quickly or feel it’s too hard. I’m going to do my best to keep it light, fun, and low pressure. But if it doesn’t work out, it’s no big deal. You have to try things, right?

I will continue to blog about this adventure. Stay tuned right here on the I Like Stuff Blog.

8 thoughts on “Teaching my 11-Year-Old Daughter to Program (in Ruby)”

  1. Very cool!

    I have that book! I thought it was good, too. I’m sure you’ll have fun with Rosey as she learns to make computers do what she tells them to do!

  2. Chris Pine’s Learn to Program book is great. We use it in classes for grown-ups. My son wasn’t into all the reading in that book, but he loved playing in irb. When I told him that he could name a variable anything, he enjoyed making potato = 4. Also printing “I love cheese” in a loop never gets old.

    He wanted to create a game with graphics, so I made a little language for web-based games. It’s not done yet, but it still seems fun. You can read about it here: http://www.ultrasaurus.com/sarahblog/2010/11/pie-game-development-for-kids/

    Good luck and definitely keep writing about your experience teaching!

    Sarah

    1. Sarah,

      How funny that your son likes printing “I love cheese” in a loop–and that your little game language is called Pie–because after my daughter learned the “puts” method (but before learning that strings have to be quoted) she tried this:

      puts I like pie

      I bet once she learns loops she’ll be making infinite tributes to pie.

      The Pie language looks like fun. I like that you’ve made it possible to do mobile as well as desktop.

      I heard about your Kids’ Track at RubyConf when you announced it. Very cool.

  3. Hi,
    got three kids, the oldest just turned six and yes, I’m waiting for her to be able to read and write that I can teach her programming Ruby too. The only problem that comes to my mind is that she only speaks German. In the end I guess I’ll have to teach her both English and Ruby. But I think she will like it too.

    1. Arinerron, it’s wonderful that you are programming on Scratch. Keep it up. Programming is so much fun. It’s great to be able to make your own games and apps.

      All three of my kids now like making games in Scratch.

Leave a Reply

Your email address will not be published. Required fields are marked *

Feel free to use <a>, <b>, <i>, <strong>, <em>, <strike>, <code>.

Code blocks:
[code language="ruby/javascript/html/css/sass/bash"]
[/code]