My son, Jayant, would be 8 years old soon. I started teaching Python programming to him 2-3 weeks back. He wants to help me out in my work :-). When I sensed that he is serious about it, I took it up as a weekend exercise. I plan to cover software testing along with this as well.
Today was Day 3. I was initially capturing this information on Facebook. But as he has shown seriousness, I decided to write about it as a blog series as a reference point. It would help me to look back at how things are progressing. It might help me to improve as a teacher. I can not look into the future, but it might be interesting for my son in future. As a by-product, it might be able to provide inputs to others who want to teach programming to their kids and/or advice me on how I can do better.
To confess, it’s a difficult task for me. I don’t consider myself as a befitting teacher for this purpose. So, I have to learn as I go along.
Nevertheless, here are the things discussed so far:
- On Day 1 (30 minutes), we experimented with Python shell. The experiments were confined to printing strings and numbers. It started with hard-coded data withing print statement. Later, it shifted to variable assignment and referencing variables in print statements. He still needs to get comfortable with creation of a new script and nomenclature here and there. But that’s fine.
- On Day 2 (30 minutes), we discussed about arrays. Computer counting vs human counting. I suggested how he can subtract 1 from human count. The term ‘index’ is not yet introduced to him. I call it a ‘position’. He later continued on his own. I was happy to see his variable names. When writing a list of pets, he named the variable as ‘pets’ and the array elements were indeed pet names. The concept of loops is not yet introduced to him. He retrieves a value using ‘computer count’ 🙂
Day 3 (About one hour)
During my discussion with Vipul, he suggested that kids can learn Object oriented programming more naturally than adults. I have decided to experiment with that. For the programs that he writes, we would follow the OOP styles. So, today onwards, the same is reflected in the discussions. Following are the questions/discussions from today that we indulged in:
- What is data? What are different data types? As he is yet to learn division in school, I briefly explained the notion of a decimal point. I explained based on time measurements, how some numbers fall in between whole numbers, and left it there. So, we focused on integer, string and boolean. To explain the boolean concept, I asked ‘Are you a good kid?’. He remarked, ‘Don’t know, you tell me!”. I said ‘True” 🙂
- I asked him to look around and list down what he sees. Then I picked up a small container and asked him to talk about it. Based on that, I asked ‘Do you realize that whatever you listed is a noun?”. He said yes. I said that in computer world, we call a noun as an object. Then from the example of container, we discussed how objects contain other objects. I asked him to apply the same concept to other things in the room. From there we discussed the ‘Has-A’ and ‘Is-A’ relationships between objects based on basic sentence formation. Every time I formed a sentence that contained a wrong relationship, for example, ‘Animal is a Cat’ or ‘Screen has a laptop’, he laughed. I said, whenever you laugh at it, it’s wrong design. Then we talked about how design and programming are different things. He added, ‘Yes papa, for example, if your pocket is put in reverse, all things would fall, pointing at my shirt pocket. We briefly discussed about the non-noun observation and the concept of messages, by taking the example of a switch and fan. There was also a brief discussion about how in the absence of the objects that an object contains, it would become useless.
- The concept of dictionary data type was discussed. Too complex for him as of now. I would refrain from it for next few sessions, unless he decides to do some basic experiments on his own.
- One of the most important discussion today was about arrays as a data type. He has already explored this earlier. Today I explained to him how to create meaningful arrays. I wrote the following array and asked him, is there something odd:
utensils = [‘spoon’, ‘fork’, ‘plate’,’mummy’]
- He remarked mummy is not a utensil. I was surprised, he said ‘Odd man out’. So, I explained that when you create an array, keep two things in mind: the data type must remain the same and the context of data must be same. I gave some more examples. Then he created some examples of his own, deliberately putting an ‘odd-man-out’ entry and laughing out loud about that.
- For the first time, we discussed a little bit on testing. I asked him to compare the two tablets he has owned so far. One was a Karbonn Android-based tab and his current one is an iPad. He said, he had to remember too many things in the first one. I didn’t associate it with any formal term like usability/user experience etc. I let him speak his heart out.
- We also had a brief discussion on how the knowledge to be gained is immense and how nobody can ‘know-it-all’. Why we should keep looking for opportunities to learn. How his teachers, his mother, his father are all imperfect human beings. I explained to him that there may come a day when he wants to work on something and it is so unique that there is nobody available to guide on that. That doesn’t mean he should give up. That just means, that he would need to try harder on his own.
Lessons for Me
- One key lesson for me is that unless I can make him laugh and enjoy programming by being selective with examples, unless I am empathetic towards his age & context, he could loose interest. I need to be very very patient. The last thing I would want to do is to kill his interest in programming because of any of my behavioral flaws.
- I don’t know whether he would remain interested in programming. I must consider this as an opportunity to build other softer traits like humility, constant learning, open-mindedness, creativity, questioning, expressing and so on.
Frankly, I don’t know how long it would continue. I am not sure for how long programming would hold his interest. Till it does, I plan to capture these moments in these blog posts.
Do you have any ideas about how I can teach him in a better way? Please share.