These days everyone talks about teaching programming to kids. In fact yesterday I came across an article by some guy mentioning about a kickstarter project for a robot to learn coding for kids and his thoughts on that. That is prompting me to take a little time of my busy life to write some stuff (I think it’s long due).
My son who recently turned 7 wants to program. It’s not because I wanted him to learn. He got to see someone else at home using Scratch for a class when he was 4 yr old. So he would drag and drop a few commands and make the cat go round in circles and make it meow and is happy. I even took him to two Scratch coding events that are meant for 8 yr and above kids. The intention is not to get him to learn much sooner but just for him to have fun and a different experience than the regular routine.
Apart from the MIT Scratch, he also has a few programs on iPad. The one I like the best for kids is the Lego Mindstorms fix the factory app. Even though what one does with it is actually coding it doesn’t feel like that at all. It’s as if the kid is trying to figure out what he needs to make the robot do as a series of commands. Of course, deep down every program is ultimately a set of commands and so it is a program, but doesn’t feel like it.
Then there is Kodable which I actually like and we got the paid version. Another one he uses is Hopscotch. I actually saw how he did with Kodable but other than that I don’t really pay much attention to his “programming” explorations. In fact, the other day he was checking out scratch website for Minecraft games online :). Nothing wrong with that, that’s what he should be doing at that age. Not immerse in coding. I am going to write more about kids learning programming.
I want to actually get back to what I wanted to write in this post. It actually may serve to validate what I want to say later.
Professionally I am interested in “computation” and the best way to articulate a piece of computation. After seeing my son struggle with scratch for anything non-trivial, I actually spent time learning Scratch myself. I did it for two reasons. One to understand the implications of scratch like environment in enterprise applications and the other to understand the complexity of computations that a non-technical person can articulate using Scratch like programs.
So, I took some notes as I saw my son trying to do some stuff and also myself when trying to solve some puzzles using Scratch. Here are my thoughts on Scratch.
1) Event driven without “wait” is difficult to get it right. It’s easy to use “Broadcast and wait” but not “clone myself” because the “clone myself” doesn’t come with an equivalent “wait” construct. So, when trying to create lots of clones with state variables changing in the loop, the “wait” has to be simulated explicitly by setting a variable and waiting till the cloning is complete.
2) Inserting blocks is fine, but when trying to readjust the sequence of blocks for logic or move them around, it can easily cause confusion and leads to mistakes. And they will be hard to debug.
3) When the complexity reaches a certain level, say two level of loops or more than 12 or so blocks, it starts to feel like writing program like a developer
4) Scratch doesn’t have function return values. For developers who are familiar with a lot of advanced concepts, programming in scratch actually feels like a burden.
5) Sprite specific variables should have been automatically prefixed so it’s easy for novice developers to readily know the difference.
6) Seems like there is no way to loop through all the sprites that have been instantiated. This forces to sometime think of the sprite specific data as variables sometimes and lists other times.
7) The fact that there is no way to refer to specific sprite also make the broadcast receiving a bit more complicated. It requires setting up an identity to each sprite via a sprite specific variable, setting the identify value in a global variable in a context that is broadcasting and then comparing it in the receiving event.
8) The grouping of various constructs like Motion, Looks, etc is a bit confusing. This is not actually a bad thing to do but having an “advanced” mode where the developers can just search and find would be good. For example, I may know I want the “broadcast” but don’t have to remember what type of a block it is. This is especially important if there are lots of domain specific blocks.
9) Once the code gets to a state where some level of debugging is required, the debugging experience is more or less the same as directly writing the code. Of course, it’s possible to watch variables and things like that, but still complexity of doing additional code review and pin-pointing what went wrong where is similar to using a programming language.
10) It’s easy to share normal programming code on the forums and things like that. But sharing scratch would require taking screenshots and sharing. This also means, other people interested in helping out would need to construct the code and then provide the fix or improvement.