Thursday, 22 January 2015

So Your Students Want to Code an iOS App?

In the primary school, we're a couple of years into developing our coding provision, which, at least for now, we manage through extra curricular activities. This way rather than mandate that all kids to learn coding, we manage it in a way that provides opportunities for all students who are keen to learn how to code, after all, despite some of the rhetoric you hear these days, not EVERYONE needs to be coder. But those students who may have the potential should certainly be given the opportunity to try it out, to see if it's their 'thing'.

Control vs Coding

If you'd like to know more about our approach to coding, see my other post here, but it should be noted from the outset, that most of the experiences these days that purport to be about 'coding' are not really. What they are is a funkier version of what we taught back in the old days (The 1990s) called 'control' using a programming language developed in 60s for educators called LOGO, by none other than luminaries like Seymour Papert, with extremely laudable goals, goals that are currently resurgent, largely thanks to the renewed interest in coding. Only back then we were controlling a black and white triangle we called a 'turtle', (MS Logo) sometimes the turtle even looked like a turtle (FirstLogo), yes amazing I know.

'Coding' in the 1990's
Spot the 'turtle'.

Control is actually a much more accurate description of what 'coding' apps like Hopscotch, and Scratch teach, and sites like teach. Once the kids learn how to control, then they are more likely to be ready to learn how to code.

The ability to control builds the foundation to be able to code.

So, ostensibly, most of the activities our kids engage in at our 'coding' activities after school, and at lunch times, are actually focused on learning how to control, not code—however, inevitably, these kids aren't going to be fooled for long. They are eventually going to realise that sequencing jigsaw blocks to control a screen sprite, (that was a black and white triangle, but now is an angry bird, or a zombie, or Elsa from frozen, the list goes on, the icon changes, but the activity remains the same) is not the same as 'proper' coding.

Reality Check

The upshot of this is that it isn't long before the kids get a little irritated, even frustrated, as they realise that what they are doing isn't really 'coding', now you can delay them, and redirect them, to ever more sophisticated iterations on the block theme, but before long (and I'm talking a week or two) I can assure you that they want do REAL coding, not just sequencing blocks that represent code. But the fact is that REAL coding is HARD! Especially if you're working with primary school kids, so how do you give them an authentic experience of coding without obliterating their little egos?

Here's some suggestions:

Control then Code

Let them taste a little of how daunting real code actually is, not enough to put them off for life, but enough to realise that they really need to continue practising in the more familiar 'block' environment for longer to build the necessary thinking skills, the cognitive capacity, to be able to work directly with code later. In short, you need to convince them that they need to learn how to walk before they can run, and maybe taking them for a decent jog/run might help convince them of that.

How? Here's how, try...


Code academy have a great little exercise, which is technically scripting, rather than coding, but your kids won't complain:

Open TextEdit on a computer and type:

<h1> Write anything you want here </h1>

Then save the file as test.html, then open the file with a browser. You'll see your very own webpage, with whatever splendiferous statement you chose to use in a brief spate of verbal felicitude, right there on the screen. 


For a great introduction to Javascript its hard to beat learn/, where kids can click 'show me the code' and they can see what the Javascript code looks like that would control (see, that word again) the blocks they have been working with.  

When they're ready to actually code with Javascript, they can use Khan Academy's 'Intro to JS'. In these tutorials, they'll learn how to use the JavaScript language to create drawings and animations. 

Apps and Xcode

But what they really want (what they really, really want) is to make an App for an iOS device. Now there's just no really easy way to do this, yes there are tools like Stencyl, and App Inventor which allow you to build Apps using the same kinds of block conventions that they used in the control Apps, albeit even more complicated. But if they still want to code, really code, with code, then you can give them a taster they way 'real' App developers do, using the Swift language in the Xcode App.

To do this they'll need to download the Xcode App for the App Store (free), then there are some great tutorials online which will guide you and them through building a simple app called 'Hello World'. Two that I've used are included below, both use Swift. Inevitably App's evolve, so the instructions in the videos below are a little out of date, but nothing you can't figure out, and if you can't figure it out ... then coding probably isn't for you! Think of it as I kind of test.  ;o)

Appcoda & The Code Lady

This is the simplest I could find, click a button and it pops up with a message that says, you've guessed it, "Hello World" (or anything you feel inspired to write).

'The Code Lady' has a slightly more sophisticated version of this tutorial, clearly explained in the video below:

Swift Xcode 6 Tutorial - Hello World App

Here's mine!