I have meant for a while to teach my son to program. He’s crazy about computer games, so in order to make his time on the computer a bit less wasteful I thought coding would be a great idea. And a great occasion to impress his daddy, which he handsomely did!
Trying it out
We started looking at the examples – these are much less dry than usual programming examples. It starts straight away with a UFO that moves around the screen and is animated. The first exercise was for my son to figure out how to make the UFO bounce on the edges of the screen. It’s amazing how many things are required to solve this problem:
- understanding cartesian coordinates
- understanding a continuous ‘while’ loop
- describing the bouncing condition as an inequality
- figuring out that reversing the sign of the x/y speed is what is required to represent the bouncing
What struck me is that the programming part was not the key difficulty for him. The real challenge was to understand and verbalize the mathematical notions. For example, he was a bit confused when it came to expressing how the bouncing needs to happen, but he finally got to the solution himself, and his excitement was a delight.
He would fix his program so the bouncing would work on the right border, and would then move on and try to understand why the UFO is not bouncing on the lower border. It feels like programming was for him an opportunity to speak ‘maths’, without fear of failure, or embarassment of getting stuck.
Forgive the digression, but this points to a likely reason why children – and adults alike – have trouble with maths. For most, maths are nothing but a dead language. Teachers try to make it more lively by letting the age of the captain, or the height of a pyramid be telling an exciting story, but their enthusiasm is usually not genuine, so not credible, let alone contagious. Not clear if these teachers realize how useful these maths can really be, and it all ends up in years of maths ordeal for most.
Now, speaking maths to a computer by programming it is the most natural way to feel numbers, the same way as playing an instrument helps understanding music. Nobody would ever study musical notation for its own sake, and nobody should study maths without being explained its beauty and interest.
Is going to be looking at an example of implementation of the Pong game, which is written for 2 players. My son will need to modify it so that the computer plays one of the players.
When I was a child, being told I might be able to do that would have seemed total science fiction to me, but with proper guidance, I am convinced that even a nine year old can give life to a Pong paddle!