Learn to code in one hour

March 3, 2014 at 10:08 pm (computers) (, , )

Apparently, today saw the official launch of the UK Hour of Code, something I am still making up my mind about. I’ve run through some of the exercises with the kids, and they seem moderately interested.  They haven’t asked to go back and try some more of the puzzles yet, so I guess its a bit too early to say.

It was certainly entertaining to use basic logo-like commands to move an angry bird around the screen and the videos of introduction by significant people in the coding world was good too.  I didn’t quite get the “show code” bit … for the most part, a series of function calls for moveForward(); turnLeft(); etc didn’t mean anything to them.  And the repeat block turns into a for loop with no explanation whatsoever, so that took some explaining on my part, but that was perhaps going a bit too far.

So did they learn to code as much of the media hype has been suggesting?  Not quite, but bringing it back to pragmatic reality did they gain an appreciation of some of the basic principles of coding?  Maybe.  They learnt the following:

  • Instructions go in sequence, get the sequence wrong and it sometimes matters a lot and other times not at all.
  • Computers only do exactly what you tell them to do, and no more, and especially are not very good at knowing what you mean.
  • You can repeat instructions
  • You can get the computer to work some things out for itself using tests.
  • Debugging can be frustrating and hard!

They had no appreciation of how computers count, how instructions are processed or what was actually in place to allow them to use a tablet computer to drag graphical blocks around the screen in order to make an angry bird move.

So, they learned some basic principles of programming (if and loops) but there is a very long way to go.  It will take a lot more than an hour I think.

And of course, one of the real challenges is that even for a very experienced coder it still takes a lot of acquired knowledge and time to write anything of any quality.  Especially when you see the polish of many free apps or web-based games (flappy bird not withstanding).

But maybe “game creating” systems is a good way to get started – get people creating something themselves, using frameworks, logic, graphics and so on available to them in such systems.  For something like that Scratch works very well, and you don’t all need a Raspberry Pi to use it, any handy PC will do.

So like all these things, the key will be in the follow-up – so maybe the idea of some computer science on the curriculum is a good thing.  I’m still undecided – coding isn’t really for everyone, but maybe everyone should try it a bit before deciding.

I guess the thing that I really find missing from all these things is the wonder, the marvel that is the “shoulders of giants” that all this sits on.  When I stop to think about what code is actually allowing my kids to drag a few boxes around on the screen to try out coding, it is quite a marvel:

On the device: javascript, running in the browser, using graphical frameworks to render HTML, delivered over HTTP, via the network stack running TCP/IP via drivers within the operating system for WiFi using all the resources of the processor, graphics, sound and network and reacting to input from the touch screen.

Over the network: WiFi to the broadband router – TCP/IP, DNS, ARP, DHCP and some Ethernet in there too between the Wifi AP and the actual Internet connection; then my router via routers in the ISP to get the connectivity to the Internet – negotiating a public IP, handling NAT, routing within their infrastructure and across Internet exchange points, exchange of routing information via peering agreements, etc, etc.

On the code.org server: operating system, drivers, and so on again, this time probably virtualised; then some kind of LAMP stack or equivalent. Yes, netcraft tells me its running Linux on Amazon EC2, although this could be some kind of content delivery network of course.

Now it will be really great if the hour of code could get some of this magic across to people – quite how much code is running to allow the world we live in to function – it would be really good if someone could find a way to give them a flavour of quite how special it all is and how much combined work has gone into something we now all simply take for granted.

Kevin.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: