Kid coding on a computer

Teaching Programming to my Son: First Attempt to Code on a Computer. What I Learned.

I started teaching my son Andrés programming in a playful manner using a board game I created that uses blocks. At the time of writing this, he is 4 and a half years old. In this post, I’ll tell you why we tried to write code on a computer, how this first attempt went and what I learned.

From the Board Game to the Computer

block vs text based programming

Block-programming vs Text-based programming.

While programming using blocks is easy to learn, when you want to do more complex projects, you use text-based coding on a computer. I’ll tell you my reasons for starting text-based coding:

  • My son asked to. He was thrilled and has seen videos about robotics and wants to get into it. For him, just reviewing how variables are set and comparing values without a purpose is no longer fun, so he made me promise I’d show him how to do it on a computer. This is the reason I accepted, even though I thought we should wait until he would be older.
  • If you’ve followed our videos and the way our game board is made, you would have noticed one of my objectives is to use as few analogies as possible. I want children to understand what code makes the character in a video game go from x to x+1.
  • I’ve noticed that some children/adolescents have difficulties switching from block programming to text-based coding. That’s why I want to introduce text-based programming as soon as possible, alongside the board game.

How programming made other activities more fun

sum subtraction activity

Calculation task.

Doing sums and subtractions just for the sake of it might be fun when first discovered, but can be boring for most kids once they master it. The same might be the case for assigning variables and comparing values using blocks.

I decided to combine the calculation task with programming on the computer. Helped, my son programmed and ran a simple program on the machine to check his sums and subtractions without needing his parents to do the checking. This simple addition was exciting for him.

Discovery day

The day before letting him code, I showed my son how to write and run a basic program on the computer.

1- Discovering text-based programming the day before. He didn’t trust that ‘a=3+5;print(a);’ was going to print 8.

First coding day

sum subtraction activity finished

1- After calculating, who is going to check? It was good that he made a mistake because he could see the usefulness of the program.

typing function call

2- Coding.

text based program

3- Executing program to verify 6+3.

correcting sums and subtractions

4- Correcting mistake: 6+3 = 9.

My son didn’t yet read automatically, making it hard for him to identify errors without re-reading the entire code. The same goes for typing: developing better typing skills will allow him to focus on programming rather than typing, as well as to code faster which means seeing results faster.

When asked to create a program from scratch on the computer, he faced difficulties even though he knew what he wanted to achieve and what he needed to do. This pointed to a need for practicing structuring solutions and applying them without fear, even with incorrect syntax.

I also realized that what is obvious to me is not necessarily obvious to him. For example, the placement of the arithmetic operator in the code versus on paper blocked him (he wanted to write 6+3=a instead of a=6+3), and I couldn’t understand what he was trying to do. Therefore, I need to make an effort to understand his reasoning, be more explicit, and explain more clearly.

Trying again 2 days after

My son asked to try again two days later (I suspect because he realizes it is easier to deal with a computer than with his parents for checking his sums). Since the last time he tried to code on the computer, he had practiced some typing by typing the text of a comic story he is writing.

This time, we did a very short session (~ 5 min.), and I only let him verify two operations. To my surprise, he was able to recreate the program, only making a mistake in spelling ‘console’. When he needed to run the program again with different variable values, he was able to just change the values without touching the rest.

second session

Reflection

Even though my son told me he enjoyed coding on the computer, and the second day was a surprise, I learned that it might be as important, if not more so, to provide him with tools that help him overcome difficulties indirectly related to programming, such as typing, reading, and better structuring his thoughts. Programming is not just about writing and running code!

One comment

  1. True that. Programming is beyond just writing and running code! You are inspiring us with your creative efforts. Good luck to Andrés.

Leave a Reply

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