Back to BASIC

15 September 2006

David Brin’s Why Johnny Can’t Program (Salon article, so ads etc.) is an interesting op-ed on how the kids of today aren’t given an instantly accessible programming environment like he and many of the previous generation of geeks had. Sample:

…if you want to give young students a grounding in how computers actually work, there’s still nothing better than a little experience at line-by-line programming. Only, quietly and without fanfare, or even any comment or notice by software pundits, we have drifted into a situation where almost none of the millions of personal computers in America offers a line-programming language simple enough for kids to pick up fast. Not even the one that was a software lingua franca on nearly all machines, only a decade or so ago. And that is not only a problem for Ben and me; it is a problem for our nation and civilization.

Brin calls for the return of a line-interpreted BASIC or a BASIC-like environment to come pre-installed on all new PCs. His nostalgic call to arms has resulted in a bulging virtual mailbag at Salon, your typical heated Slashdot conversation, and plenty of blogchat about it.

I can see Brin’s point, and agree with it, partly. Programming is no longer one of the up-front applications supplied with a computer, when in the past it was so different. My first programming ever was tinkering around with Locomotive BASIC – sorry I actually meant Mallard BASIC (my memory failed me when I first wrote this piece) – which came with my father’s Amstrad PCW 9512. I started out inputting programs from magazines, before starting to make my own. Soon after, at school I became the class whizz with BBC BASIC – but I don’t recall it being that fun. BASIC involved lines and lines of boring stuff, and some downright tedious parts (Locomotive Mallard BASIC suffered from not having a clear screen function, so you had to learn all about control codes just in order to do that). Most other kids who used BASIC got bored quickly and ended up just end up doing this:

10 PRINT “POO”
20 GOTO 10

Instead, I remember having a lot more fun with Logo. Logo’s visuality meant you could simply and quickly render, like drawing pretty polygons and stars with the Turtle (the onscreen version anyway, the floor one never really worked in our school). There was even the hidden delight that if you mucked up your programming in some way, you sometimes produced weird and interesting patterns – that leads to the wonderful moment of realisation, when you work out that a computer language can do stuff you couldn’t imagine, and you have the potential to find out how to do it.*

So while I agree that more accessible languages need to be made available I don’t think a return to BASIC is the way forward. Python is mentioned as an alternative – I love Python, but it is perhaps a bit too high level for Brin’s tastes – he’s more interested in exposing the underlying mechanics of an algorithm, like searching a string or walking through an array – a glimpse at the nitty gritty, to gain an appreciation in how computers work under the hood.

But for all its illuminating simplicity, BASIC teaches you very bad programming habits, and it isn’t as fun or intuitive as Logo was, but Logo suffers in the modern day; while when I learnt to program 15 18 years ago, most of the computers I used were command-line interfaces with limited graphical capability, so what you made on the screen wasn’t too far off what you saw normally. That no longer applies – make anything in Logo these days and it’ll probably be a bit, well, crap compared to what you’re used to seeing.

So a better language for learning needs to appreciate and incorporate the improvements in computers’ graphical and UI capabilities; I don’t know enough about scripting languages for million-colour 3D environments to know if any out there that are suitably simple and intuitive enough. Additionally it needs to incorporate networkability – learning how to start out on a computer is no longer a solitary activity. Find some way of getting your code to be more social, provide an environment that allow kids’ code creations to interact (I dunno, some sort of collosseum for hackable virtual robots that fight each other to the death, fuelled by 3D fractals that you create with your code, or something) and you could have the basis for a viable social network; it would never get the millions MySpace does but even a few tens of thousands of enthusiasts would produce enough interest to get talented kids who may not have thought programming can be fun to change their minds.

* Alright, I’m sure I didn’t frame it in those words, nor did I fully actually appreciate it at the time. But looking back on it, it was probably one of the key moments that set me on the path to being a geek for the rest of my life.**

** Second nostalgic post in a short space of time. I should just rename this blog I *heart* the 80s and get it over and done with…


7 Responses

My father was a lecturer in Computer Studies, his dept loathed BASIC because of the bad habits.

But it was the only computer language that I can remember at all I did dabble with Fortran and C but all forgotten now.

It was fun though writing little programmes that drew lines and printed out your name and such like, for my Computer Studies O level we had to write 4 programmes in BBC BASIC ah happy days.

I *loved* BBC BASIC, and the whole 1983 Sunday Times-endorsed idea that you should get a home computer so that you could teach youself to program. It strikes me now that there is in fact a new “instantly accessible programming environment” – and it’s called a web browser. HTML+CSS+JavaScript offers a very similar environment: quick to get started, interpreted, forgiving, and easy to share.

I did consider advocating JavaScript as a ready-made programming environment, but it has a few problems: standards are not universal across browsers, there is a lack of graphical capability, and browser debuggers tend to be very unhelpful. Also things like the DOM and event model are not simple nor intuitive. That said, someone could build a Firefox extension to solve all these problems, and have a simple in-browser line interpreter frontend for JS – that could work.

some sort of collosseum for hackable virtual robots that fight each other to the death

Robocode got my son and me into Java, briefly and rather abortively – there was a chasm to cross between modifying the default robots and coding up the kind of thing that won contests. I’m still intending to get into it properly some time. But Java’s not the most welcoming (or forgiving) of languages, for kids or aging ex-programmers.

The fact that computers have almost become invisible suggests that children will not feel the need to program as acutely as I did when I got my first computer. I had no real choice then, but kids do these days.

By invisible I mean that to most kids a computer these days isn’t a computer. It’s a music library, or a communications conduit (MSN Messenger et al), or a games console, a word processor, whatever. Its purpose is no longer to computer, it is to do something else. Look how many ‘Joyces’ Amstrad sold when they called it a word processor and not a computer!

A bit like cars where once upon a time knowing about the engine was a good idea if you wanted to drive one and nowadays you barely need to know how to drive with all the bits and pieces on them.

I like the fact that children, or anyone for that matter, have so many other choices with their computer.

Seems like a good thing to me. The software stars of tomorrow will still be found. The rest of us can get on with doing something useful with our machines!

I thought I’d let you know that David Brin replied to my blog about his article with some good clarification about “Why Johnny Can’t Code”. I’ve linked the blog exchange at my name’s URL. Seperately, from his web page: “What I didn’t expect was the flurry of intensely passionate replies!” :)

I’ve engaged with this, too, having got the “ZX Spec”/BBC/PCW Basic t-shirt. My own memories of the BASic age are that although it was easy to get started, and conveyed important concepts, it was incredibly time-consuming to make it do anything interesting or useful. And if you are trying to get kids interested, rapid pay-off is vital.

I’ve decided I ought to learn a real programming language, anyway, and am taking advice from my commenters – it’s currently about 60-40 between Python and Ruby. Python has been ported to Nokia/Symbian Series 60 OS, which is certainly an advance, as you can guarantee the kids will all have mobile phones.