A Basic Lack of BASIC

David Brin makes an interesting point in a recent article on Salon.com (apologies for the ‘click the banner’ hoop you have to jump through to get to the story). The author of such popular SF works as Startide Rising and The Postman is also a programmer, and he has a son who shows signs of being a programmer as well. Now various people can argue that we don’t have enough programmers, or that we do, or that the ones we have are too expensive. But I don’t think anyone will consider it a bad thing if a young person who is inclined toward the art finds the right tools to assist in the learning curve. The point Mr. Brin makes that somewhat surprised me is that we used to have the perfect tool, and now largely have it no more. That tool was BASIC.

The word ‘BASIC’ is an acronym that stands for Beginners All-purpose Symbolic Instruction Code. It was designed all the way back in 1963 by John Kemeny and Thomas Kurtz, both of Dartmouth. The point of it then was to provide a fast way for students new to programming to get up to speed on the fundamental concepts: stepwise execution; flow of control; instructions; operators; operands; variables; input/output; etc. It used to be that every IBM-compatible PC had BASIC burned into a ROM on the motherboard, and there were any number of more capable versions of it available on tape or 5.25″ diskette once those became common. Incidentally, two guys by the name of Gates and Allen got their start implementing BASIC for the Altair.

The attraction of BASIC was its austere simplicity, its interpreted execution model and resulting immediate feedback loop, and the wide range of things you could do with it, from record-oriented I/O and data processing to graphics and printed output. You could even read/write memory and ports directly. In fact, being the kind of kid who ripped apart perfectly functional devices to see how they worked, as soon as I got my hands on a PC compatible with BASIC I used peek and poke to mess with memory until I found the region that controlled the screen. That was probably the single most thrilling moment I’ve had as a programmer. Just typing load “mygame.bas” and seeing the cassette player come on knocked my socks off. Kids who are inclined toward programming just don’t have that kind of fast, easy access to a channel of control over the machine that so fascinates them. For me, BASIC was a natural launchpad to procedural BASIC, and then on to Pascal, Assembler, C, C++, Javascript, C#, and everything else I have done since.

Instead of BASIC, what young programmers today have access to is… what? Java? Visual Basic? Even though these languages share some of BASIC’s positive traits, i.e. garbage collection, interpreted or JIT-compiled execution models, weak typing, late binding, etc., they are far more complex, both in terms of their syntax and program structure, and the environmental complexity they have to deal with to make cool things like screen displays happen. Brin makes a good point when he relates that many math textbooks still include small algorithm examples in BASIC, that kids cannot run because nobody has a minimal BASIC interpreter at hand on their machine. Not that there aren’t decent BASIC interpreters available. The original inventors of the language still sell TrueBASIC, but it is $39 for the most minimal version. The whole point of BASIC was that it was just there. If you booted an IBM compatible with no O/S you got a BASIC interpreter. Brin believes, and I agree, that this had a lot to do with the U.S. dominance of computing and software development that lasted for decades.

I should note that there is a simple BASIC interpreter for the Mac. There are specialized BASICs for game development. There are actually a lot of different free BASIC variants for Linux, Windows, and DOS, but most of them seemed to be specializations for one purpose or another, and most were compilers that produce stand-alone executable binaries. This is understandable, if you don’t take into consideration the needs of the absolute beginner. The simplest variant I located, ScriptBasic, is a compiler that will at least let you type in a quick program and execute it, but I think when you lose the line-oriented interpreter of the original you lose quite a bit of the approachability. In the original you didn’t have to think about anything except the lines of code. There were no files, or directories, or configuration files, or compiler command line switches, or at least you didn’t need to deal with these things unless it was important.

Over the years I’ve thought often about some sort of beginner’s programming environment, mostly because it always seemed like a good commercial niche. My daydreams in this realm usually tended toward things like Logo and other such tinker-toy approaches. What Mr. Brin made me realize is that BASIC, the old-fashioned intepreted kind, is already perhaps the best model for a beginning programmer. You just dive in and start doing stuff, and that’s what ignites the creative juices. I’ll keep looking for a suitable interpreter, and if I find one I will make it available here in the site. It might even be fun to write one, and I think it would not be too hard in .Net. In any event, I have been a big fan of David Brin’s since reading the Uplift saga, and I am a bigger fan now that I know he cares about beginning programmers too.

Leave a Reply

Your email address will not be published. Required fields are marked *