ThoughtFactory.CreateThought() A random collection of thoughts from an easily bored developer

13May/080

The Saga Continues

After the success of her first programming lesson, my 5 year old daughter was eager to start the next one.

Previously we had covered boolean logic and control flow, both of which she had no trouble with, so she was ready for something slightly more complex. I had a few ideas about what to talk about next, but I didn't want to decide until we were both sitting at the desk, ready to start the lesson.

The first lesson really drove home the similarities between teaching adults and children. It's all about being able to capture someone's interest for long enough to get your point across. The good thing about kids is that they make it fairly obvious when their attention span is waning and they are no longer taking on information. Adults have a nasty habit of trying to be polite, which only ends up wasting your time and theirs.

I left the decision to the last minute so that I could take my daughter's current demeanor, energy levels and alertness into account. If she was easily distracted then I'd want to avoid some of the more complex topics, and only explain short, easy to swallow chunks of information.

This turned out to be a good call. She had previously discovered TuxPaint on my Ubuntu box, and was already asking if we'd have time to play "the penguin game" (i.e. TuxPaint). I immediately knew my chances of having her undivided attention were shot.

As an aside, I highly recommend TuxPaint. I've installed it on her laptop, an old G4 iBook we had lying around, and she plays with it most nights. TuxPaint also has the honor of being the first open source project I've ever donated to. The guys who make it even offer really cool kid's shirts so your pre-schooler can show their support for open source software. It almost makes up for the fact that they don't sell FireFox shirts in kid's sizes. Almost.

I ended up ditching any ideas of discussing encapsulation for something much simpler. I figured that I could sell the concepts of variables and functions before she got bored and started asking about that silly penguin again. These two concepts would be enough to round out her understanding of some basic procedural programs, and probably allow us to actually create something cool.

Variables were easy to explain. I was considering starting with a brief overview of lambda calculus, but that might get us a call from child services, so i toned it down a little. At the heart of it, a variable can be explained away as an alias for something. It's just another way of referring to a particular "thing".

I appealed to her natural sense of vanity, something every 5 year old has more than enough of, and explained variables in terms of her age. She loves writing her name, so this was a good attention-getter.

EMMA'S AGE = 5
# I used this to explain what happens on her birthday
EMMA'S AGE = EMMA'S AGE + 1
EMMA'S AGE IS NOW 6

I explained that, after stating that her age was 5, we didn't need to say "5" over and over again. It was enough to say "Emma's age", because we knew that she was 5. I used her birthday as an example of changing the value of the variable. Every year she has to add 1 to her age, so on her next birthday she will be EMMA'S AGE + 1.

We tackled functions next. She loves baking, so I thought I'd use a concept of reusability that she would already be familiar with: a recipe. We wrote out a definition for baking a cake. Of course, I have no idea how to bake a cake, so I wouldn't recommend following the recipe...

BAKE CAKE()
{
	Add Flour
	Add Milk
	Add Eggs
	Add Sugar
	Add Butter
	Mix
	Put in Oven
}

Now that we knew how to bake a cake, we could bake as many of them as we liked.

BAKE CAKE
BAKE CAKE
BAKE CAKE
BAKE CAKE

After learning about functions and solving the world hunger crisis with cake we decided to call it a night.

Hopefully she's now learned enough to have a basic understanding of procedural programming, or at least enough to let her understand a simple programs, which is what we plan to do next. I don't expect her to be writing the next Crysis, but she should be able to sit over my shoulder and understand a Hello World or two.

Tagged as: Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.

Sharing Buttons by Linksku