Towards the end of last year, just before her Christmas break, I decided I need to teach my daughter (who had just about turned 7) to code. As is my wont, I put this on twitter and asked for suggestions. People gave me a zillion.
The one that I liked best was to use Replit 100 days of code so that she can learn Python. I set up a Replit account for her, showed her how to watch the videos and do the assignments there, and let her be.
She hared through the process. In some 15 days, she had already reached some Day 20 of the “100 days of code”. And then she promptly lost interest. In the following 3 odd months, she crept up to Day 26. Through the process I had been extremely hands off - occasionally helping her with some code or syntax (she struggles with the indentation in Python), but largely letting the MOOC teach her.
And then, last month, when her summer holidays came by, I figured it’s a good time to revive her coding lessons. She had apparently given up on the assignment for Day 26 because she got stuck somewhere, and so I decided to help her out with that and move her along.
I sat with her and watched her struggle through the code, and I quickly realised what the problem was - the issue with Replit 100 days of code is that it does a brilliant job of teaching syntax and how to code, but an extremely poor job of logic.
Why should we use a while loop here and a for loop there?
What should come inside the loop and what should come outside?
Etc. And thinking about it, based on the opinion I’ve formed of “boot camp data science”, I’m not particularly surprised. I’ve written about this in detail in one of my other newsletters.
Basically, in the “boot camp approach” to learning, everything is broken down into a series of steps. There are some playbooks that are taught to you, which you need to go through in order to solve the problem. If you want to analyse data, follow these steps. If you want to build an ML model, follow these other steps. Coding is reduced to learning syntax, and how to do a 100 things.
And while I’ve traditionally NOT been a fan of this kind of approach, I think the coming of LLMs means that this approach is even less relevant. For example, nowadays, for some prototypes for my company’s product, I’ve been trying to code in Python. Now, Python isn’t a language I’m comfortable with at all. However, with the help of ChatGPT I’ve been able to churn out a fair amount of fairly good code in the last few days.
The broad contours of the logic I need to tell it - rather, it can generate by itself but needs human oversight, but the low level syntax and stuff (even if it takes a few shots) it handles particularly well.
So coming back to my daughter, what I found is that she knew the precise syntax for a for and while loop, but had no clue why one should use either. She kept talking about conditional statements as “if-elif”, and I had to teach her that sometimes there need not be an elif or even an else. Again, she is very young, but her school has taught her a fair bit of maths (much more than what I had learnt at her age), and I had been trying to get her to express her logic in code.
In any case, over the last couple of weeks, I’ve taken to teaching her. I’m making up assignments and giving them to her (mostly maths problems - today she wrote code to find the HCF of two integers), and guiding her through how to solve them. The struggle I have is in terms of teaching her just the right amount - if I teach too little, it’s too challenging for her and she abandons it. If I teach too much, is she learning at all?
I’m enjoying the process so far. It absolutely helps that she knows the syntax, and so once the logic is formed in her head she can quickly get a draft out. For example, today I said, “see you need to end this loop early, as soon as one number is found. How do you do this?”. And she immediately remembered that she could use “break”.
The plan is to get her to understand the logic and be able to express it in code. Maybe next year (or the year after) I’ll teach her to analyse algorithms and make them more efficient (today’s HCF code was O(n), where n is the smaller of the two inputs).
Love it