Tonight was looking to be a rare quiet Tuesday night. The lass had Brownies right after school and the boy had his karate class. That may seem like the makings of a busy night, but the schedule was such that the Wife and I easily had things covered. I was tempted to attend an extra karate class myself that was scheduled after the boy’s classes were completed. Dinner was all set and both kids had a good jump on their homework.
Then the boy asked “Dad, could you help me write my first program?”
He’s been steadily interested in programming for awhile now. It started with questions about computers and what “code” is and the like. I wrote awhile back about installing Scratch on one of the computers, which is a sort of visual programming language. He’d worked with that, but lost interest in it after a week or so. Since he’s continued probing about programming trying to understand it better. He’s even taken to asking for a computer of his own so he can learn programming using that.
Tonight was the first time where he straight-up asked me to work with him. I realized I wouldn’t be going to a karate class tonight.
It wasn’t until I actually started thinking about how to teach him that I realized there were some unfortunate hurdles that are necessary for the act of programming, but have little to do with learning to program. Understanding files and executables and how to work an editor are a few.
So for tonight, I worked on my little laptop with him. I took care of the non-programming-but-necessary stuff and let him do the typing and actual coding. At least, as much as I could. We started with the classic Hello World program and went from there. A little anyway. After he played with the print
statement in python
for a bit, I started showing him the for
loop. After printing out a series of numbers, I then showed him how to use nested loops to print multiplication tables. He played with that but wanted more.
The “more” is where I’ll need to do some work. The vast majority of my programming has been relegated to the command line. The choice has been somewhat deliberate- graphical stuff is pretty demanding and more finicky when it comes to design. It’s one thing to read and process files, quite another to define a graphical interface and process user input.
Naturally, the boy wants to learn how to manipulate graphics, which I’d say is equivalent to learning to run before learning to walk. That said, there are code samples available that should suffice as an example, so perhaps he and I will do some learning together. For tonight, however, I was saved by bed time.