Why javascript for teaching coding

Unofficial_JavaScript_logo_2.svgSo you have a kid or group of kids who have been playing with Scratch. They have the basic coding principles down pat, but are beginning to bump up against walls with Scratch – where next?

A couple of years ago I’d have said Python. And while it’s pretty clear that many people are still saying Python is the answer, I am no longer amongst them. For me the answer is Javascript. Here’s why:

  1. It’s platform independent. You can program anywhere that has a text editor, you can program in the cloud with some nice IDEs, you can program on an iPad or any other tablet, if your eyes are up to it you can program on a phone.
  2. It’s platform independent. Once you’ve done your programming on any of those places, you can see what you’ve made in all that same range of places. Javascript runs in the browser; no need for your audience to install anything or sign up to anything.
  3. It’s a real language and you can get jobs. Now I know Python is a real language but it’s simply not being used in environments pertinent to kids. Javascript is being used by Google and is popping up all over the place. Learning Javascript is not just learning coding generally it’s learning a useful specific language. And jobs.
  4. It makes cool things. Web pages, cool-looking games, interactive sites – all right up there with Javascript. Python is all about the text and even the best of teaching environments (I’m looking at you Grok) can only make it so entertaining.
  5. There are resources everywhere. There are a huge depth of resources for teaching Javascript and for solving any problem you might bump into.
  6. Good return on time-invested. It’s easy to get something cool up and running quickly with Javascript. For younger kids just getting a web page up is almost enough – add in a button that changes the colour and they’re in heaven.
  7. It scales up well. Even though you can get some quick runs on the board, Javascript will also scale up to industrial-strength programs. So the basics you learn will really take you places.

Reasons not to like Javascript, or to prefer Python:

  1. Semi-colons, braces and brackets all over the place.
  2. Having to work with Javascript, HTML and CSS for best effect can be confusing.
  3. Python is just simpler – but that has to be balanced against what you achieve with it.
  4. If you want to be a programmer, Python is a good building block to other languages. Which is why it’s taught in first year university. But most kids wont end up being professional programmers and if they do head that way they’ll end up knowing both, and more.

Ultimately, it’s arguable that it’s a matter of choice – there are enough pros and cons to both. For me, though, while Python is cleaner and more elegant, the key thing that Javascript brings to the party is the ability to make things the kids are interested in and can then show-off to friends and family. ‘Look at this game on a Web page I designed’ is going to trump ‘have a look at my Python program that converts one bit of text to another’ every time.

One thought on “Why javascript for teaching coding

Leave a Reply