Kids and Code: Conditions and loops

Last week I published the first post of Kids and Code where I started recording the process of teaching my six-year-old son to code. We used code.org which is just awesome, specifically the Minecraft game which has just the right balance of difficulty, engagement and entertainment. It’s mostly dragging and dropping blocks which represent procedures, but it’s a great way of getting kids to think about the structure that goes into code. Even at six years old, Ari picked it up very quickly and is genuinely enjoying it, so we recorded another one with some more advanced concepts.

Here’s another short clip where he starts using two fundamental coding constructs. Firstly, there are conditions – “if a condition is met, then perform a task” – which is an absolutely essential component of any software development. Next there are loops – “repeat something over and over again” – also fundamental in the code all software professionals write. Here’s how he went:

Consider the behaviours he’s able to demonstrate here:

  1. Nesting: He has to get the “if” condition nested within the repeat control. I really like the way this is visualised here where you can clearly see the contrasting colours and drag blocks within different levels of nesting.
  2. Reading code: We talk about how the cobblestone is only being laid when there’s lava and I ask him to show me where in the code this is happening. Actually being able to understand the coding construct that causes the behaviour is a really key skill.
  3. Code optimisation: Towards the end, he begins by trying to add another “destroy block” command after his loop. We talk about how he can use his existing loop by simply incrementing the times it’s repeated instead.

The other thing I’ve noticed the more he does this is how suitable the touch screen is for young kids. You can see him using his finger on the screen the whole time rather than the mouse, not by my prompting but just because he’s obviously finding this to be a more intuitive user interface. The Lenovo Yoga 900 I wrote about in the previous post is perfect for this and it means that as we progress through his education he can learn the fundamentals of using a PC as well as how to interact with modern touch-enabled applications.

Teaching kids to code is an enormously valuable thing to do with your time and I had several friends reach out to me after the last post with a renewed enthusiasm. It doesn’t necessarily mean you’re setting your kids on a path to be a software developer, rather you’re empowering them to better understand the increasingly technological world they live within today.

I’ll leave you with this very short clip of Obama encouraging kids to get into the hour of code in 2014 and I especially like this segment of the video:

Don’t just consume things, create things. Take an hour to learn more about the technology that touches every part of our lives.

That’s not just our present reality, it’s their future too so help them to be a part of it.

Continue reading Kids and Code: Conditions and loops

Kids and Code: Simple programming on code.org

There are few more valuable skills for kids these days than knowing their way around technology. In fact, I’d argue that you could say the same for adults but particularly when you consider the skills that are going to be most valuable in the future for our children, understanding how the connected world functions is key. Their existence is fundamentally different to ours and if you were born in the 70’s like me (or even earlier), just think about how fundamentally different their education and social interactions are; we had no Wikipedia to refer to, no online discussions to ask questions in and frequently, not even a PC to type on (I was a teenager before my family had one). On the other hand, we had no social media to make dicks of ourselves on the public record nor camera phones to permanently record our misdeeds. Making tech savvy kids is not just about leveraging the technology for good, but ensuring they grow up using it responsibly.

I have a three-year-old daughter for whom technology is little more than Netflix and the occasional iPad puzzle. But I also have a six-year-old son – Ari – in his first year of school and I’ve been thinking about the best way of getting him more involved in technology in some sort of a coordinated, planned way as opposed to just allowing it to happen implicitly. I don’t necessarily think that six is the right age for all kids, but Ari tends to be quite conscientious and patient (virtues he’s more likely inherited from Kylie rather than me!), which predisposes him to sitting down and learning.

Entirely unexpectedly yet at the perfect time in his development, an opportunity presented itself when Lenovo sent me over a Yoga 900 (read the bit about Lenovo at the end of this post for the background, I want to focus on kids coding first). The best possible use I could think of for the machine was to give it to this guy:

Ari with his new Yoga 900

Let me show you the first thing we’ve got him working on.

Teaching kids to code

I get a lot of questions from people about how to get their kids involved in tech and what they should be learning so with this opportunity now presenting itself, I thought the best thing to do is use Ari to help answer those questions. I’ll try and keep this series going as I find good resources for kids and as he picks up new skills, but where I thought we’d start is with code.org. I used this site as part of the Hour of Code event in December when I helped out at the Microsoft store in Sydney, watching as kids of all ages started to learn the fundamentals of what it means to create software. It’s totally free and it’s all browser based so there’s nothing to install and it’ll work on most operating systems and devices.

Here’s how Ari went on his new machine:

In case you’re thinking “Hey, this doesn’t look like code”, take a step back for a moment and have a think about the behaviours he’s learning and these will particularly resonate if you’re from a software background yourself:

  1. Problem solving: He has to work out how to achieve the objective using the tools he’s been given.
  2. Thinking procedurally: He uses the blocks to execute discrete functions one after the other (move forward, move forward again, etc)
  3. Testing: He starts writing the “code” then runs it to see how it executes before proceeding with the next step
  4. Troubleshooting: He turns left after shearing a sheep when he should have turned right; he needs to work out what went wrong with his program

These are behaviours that are foundational to creating software and they’re all things I’ve done thousands of times before. I love that it’s all wrapped up in Minecraft (and other genres, for that matter), as it obviously increases the “stickiness” for kids and particularly at this age, they grow tired of things very quickly if you can’t keep them engaged.

How young is too young?

I honestly have no idea, but I’ve taken inspiration from my mate Adam Cogan and I wanted to share what I think is just an outstanding result for getting kids involved in tech. Both his daughters started writing a blog and recording YouTube videos at a very early age. Eve’s blog was started four years ago when she was 10 and Ruby’s blog began when she was only 8. Have a flick through and consider the positive exposure they’re getting to technology and how they’re using that opportunity. Especially when watching their videos, you get a sense of the presence they’re starting to carve out for themselves online and how their familiarity with the technology is helping them not just with their studies now, but is paving the way for their future professional aspirations.

I’m sure there’ll be people who feel that level of exposure that early is too much and I’m sure that’s the case for many kids. It may be for Ari too, I don’t know yet, but I love the idea of being able to give kids the opportunity to embrace technology in such a positive, constructive way.

With support from Lenovo

Let me set some context as to why Ari has this machine; I started buying Thinkpads in about 1996 back when they were made by IBM. They were rugged machines and mine travelled with me around the world in ‘99 when I spent a year overseas. Much of what I do today had its genesis in that machine; that was when I really started getting involved in the Microsoft stack, particularly classic ASP and SQL Server. When I arrived at Pfizer in 2001, Thinkpads were the standard machine and for the next 14 years, that’s all I used, even as Lenovo took over the PC business from IBM in ‘05. Even when I purchased my own machines, it was always a Thinkpad and in fact I’m writing this on my W540 that I purchased in 2014 which has now been around the world a dozen times and still feels like new.

I obviously share a lot of what I do via social media and frequently that includes pics of what I’m working on – literally the machine I’m working on – and combined with a healthy Twitter following, that makes for influence so they invited me into their Insiders program. I provide them with feedback on some of their product strategies and they occasionally send me Lenovo products. I always prioritise independence and yes, that includes expressing views on controversial things like Superfish (I have something specific in mind I want to write on this). By reading this blog you’re probably a lot like me in terms of most new technologies and gadgets exciting you and I’m genuinely enjoying exploring products I wouldn’t have previously thought to pay much attention to (how I ended up using the Yoga Tab 3 Pro is a perfect example!)

But the Yoga 900 really is a great device. I already had one which is now my default machine on planes or when doing things like email (I tend to save the bulkier W540 for things like coding and video editing). It’s also a perfect device for kids because it can do the tablet thing as well as being used as a normal PC with a proper keyboard. Plus, it’s a very sturdy piece of kit which I hope will be resilient to the inevitable battering that kids tend to give just about everything they get their hands on.

What next?

I’d love to hear suggestions from people about either what I should be teaching Ari next or what you’d like to know in order to help you support your kids. If it’s something we can make a useful video out of then we’ll give it our best shot!

Continue reading Kids and Code: Simple programming on code.org