Programming and kids (or how I learned to love code)

I have three boys that I want to share some of my passion for coding. I don't need my children to be programmers, but I want to share what I find so enjoyable about what I do, but I struggle with where to start. So, I have been thinking about how I learned to code and what drove me. 

Coding was something that I first encountered as a boy of about 11 with my trusty Commodore 64. To do anything, you had to use Basic. I had no idea I was using Basic when I told my computer to load a program. I just knew that `LOAD "*",8` would start the process of loading my favorite games from my attached disk drive. 

From there, curiosity led me to more commands. I could sense the magic behind the little bits of English, numbers, and punctuation. Something amazing would happen that was more than just letters on a screen. It was a child's curiosity that pushed me forward. I was hooked on the machine and the magic of code behind it.

Computers were limited in 1984. They didn't have fancy user interfaces or even fancy input like mice. You had to type in text to make them do anything and that text was arcane, opaque even. What did `LOAD` mean? Why did you have to then type `RUN`? You had to figure it out without being lead to it. I think this lack of context pushed me to learn in a way you don't need now, but computers had something more that pulled me. They had video games.

Someone had figured out how to create puzzles and interactive stories, gateways to the imagination. These programs pulled me into code. I wanted to learn how to create them. I think this was because they didn't feel like something I couldn't create. There was no 3D, no unattainable production value. I knew I could do it even if I couldn't see precisely how. 

I think it is different now. Modern games present children with intricate works of art and engineering, often requiring teams of developers and artists in the hundreds to produce. It is not clear how something as complex as a third-person shooter comes into being. I fear that my children will not see the same path I did to the world of code. A world that I love.

One approach that I have seen and tried is simple visual programming. I've done some Scratch with the kids, but it hasn't had sticking power. They think it is neat that you can plug in some widgets, and something on the screen moves or the computer makes a sound, but they quickly lose interest. It reminds me of my early experiments with Logo and Turtle. I thought the graphics were neat, but it felt cheap and simple somehow. Building some cool visual was interesting, but it never felt like a puzzle to me.

Puzzles are essential because a good puzzle gets under your skin. It pushes you to solve it. Nags at you. It is something that pushes your boundaries and provides a feeling of accomplishment in the solving. Puzzles are what makes math so interesting, and for me, at least, what makes developing software so great. I solve puzzles for a living. Not messy human problems. No, neat little logic puzzles.

A good programming problem is a puzzle, but a puzzle that changes at each step. One of the first things everyone learns in programming is to print out text, the ubiquitous 'hello world' program. It is an excellent first step but not yet a puzzle. 

With a clear set of instructions, anyone can create a 'hello world' program. For it to be a puzzle, you have to be able to interact with it. So, the next thing we usually learn is how to get user input. Now you can have it print your name or any other thing that pops into your head. Of course, this is still not a puzzle.

What turns programming from dictation to puzzle-solving is asking what else can I do with this input or output. Guessing games are a good start. I remember building "choose your own adventure" games as a kid, working through each problem to solve the next puzzle that I threw in my way. Creation is rewarding. Learning and overcoming challenges is a large part of why that is. Programming is the joy of solving problems and creating something that is outside yourself.

From there, I grew and learned, and the puzzles got more complex because my tools got better, and old problems got simpler. I did this because I found the joy of solving problems and building things. In the end, I learned that many problems in life were just puzzles to be solved. 

To show my kids what I found so compelling, I need to provide them with the seeds that turn into puzzles, with problems that are fun to solve. They need puzzles to tease their minds and help them build the tools to solve bigger puzzles. 

In the end, I don't think the skills I want to teach are about coding. They are about building confidence, solving problems in steps, and troubleshooting. These skills are about how to deal with a lot of what life throws your way. There are, of course, other ways to learn these skills, but I also want to share one of my joys with them.

Comments

Popular posts from this blog

Bigger than the cloud?

3 problems with quality code