Basic instinct: how we used to code
In praise of Beginners All-purpose Symbolic Instruction Code
I’ve recently caught myself, like some horrific solo re-write of the Monty Python Four Yorkshiremen sketch, waxing lyrical to my two iPod-wielding young ‘uns about the good old days; when men were men, computers were effectively clockwork, and computer games… well, come to think about it, they still cost about 69p. But you didn’t download them from an app store. Oh no. They came bound into computer magazines and had to be typed in by hand. And oh yes, they were in an arcane language called Basic.
1980: that last year of primary school when I was shown my first computer, a Sinclair ZX80. Sixth-formers from the local comp were there to test our reaction times using a necessarily simple program they’d written. Themselves. Wow. Heady stuff. Only four kiddiewinks were allowed in at a time, and even then we were only allowed to touch one key on the bizarrely colourful, flat keyboard. But it was a computer! Just like on Tomorrow’s World!
Admit it, YOU wrote this on a shop's demo micro, didn't you?
Fast-forward a year: home computing hit the big time. At senior school, various tribes formed round newly-acquired weapons of choice: parentally-purchased ZX81s and Vic-20s, with a smattering of TRS-80 (dads in technical jobs) and the occasional Commodore Pet (dads managing the dads in technical jobs).
Oh, and that one guy whose dad was an electronics engineer who owned a 64K SuperBrain that came with a built-in green screen and something called a database. Actually it was my Nanna who bought me that 1KB ZX81, and my sister the small B&W rotary dial TV to run it on. You can imagine the bargaining that ensued…
Pretty much every home computer in the early 1980s came with a Basic interpreter as standard. The exception? The Jupiter Ace running Forth in 4KB. Weird, but fun.
Choose your weapons: which platform did you pursue?
However you stored your programs - cassette, Microdrive or pages ripped out of Your Computer – even the most disinterested luddite almost certainly started their games with a variation of
RUN, the programming equivalent of mono-linguists strangling 'dos cervezas, por favor'.
Even when the program was a machine-coded version of Space Invaders shoehorned into 1KB, you invoked it by typing this arcane Basic on an actual keyboard.
It didn’t take a mammoth chunk of Basic code to fill that paltry 1KB of memory - ah, how we pined for the wide open spaces of a 16KB Ram Pack - but only having a single kilobyte meant that any viable program you found could pretty much be copied blindly, assuming the faultless coding of the author (ahem).
A dialect for every machine
And thanks to the ZX81's and later Speccy's per-keyword command entry, debugging was just a simple matter of your mate reading the code v-e-r-y s-l-o-w-l-y as you moved your finger across the screen checking what you’d written. Understanding was there none. And if that failed, and if you were lucky, you saved your masterpiece-in-progress to tape, to fix next time he was allowed over to play. Heaven help the numpty who jogged the power cable.
Next page: PEEK and POKE, PLOT and PRINT
Re: Ughh... Still shudder when I recall those days
Nothing wrong in a language which only has 'goto' for flow control. How do you think assembler implements those fancy 'Do..While' and 'For...Next' structures? That's right - 'IF...THEN', manually decremented/incremented counters and 'GOTO' - much that same as you'd have to do ti in BASIC.
If you understand how it works at a low-level, it's easier to appreciate it at high-level.
My single mother was very poor so there wasn't much chance of me getting hold of a computer in those days, fortunately many of my friends had parents who could afford them. So I learnt to program on my friend's devices. Often I actually used them more than they did. Many times friends would simply donate their zx81's & then spectrums to me for months on end!
Eventually a few years later my Mum & relatives clubbed together and got me an Amstrad CPC 64 (green screen) and that's when I found the most useful programming book I have ever encountered.
It was a collection of about 30 basic programs for the CPC64, by this time due to the 64k ram typing many pages of basic into the thing was quite a task. The brilliant thing about this book though was that not a single one of the contained programs actually worked as printed! I would spend days going over the code checking for syntax errors on my part.
Once it was clear I had made no mistakes it was time to start trying to fix the code myself. The buzz I used to get when all that gibberish started to make sense was fantastic. Most of the games were nothing to get too excited about, but becuase I had managed to get them working myself they were a lot more satisfying than they would have been.
I'm sure the author(s) of that book didn't set out to produce 30 broken programs, but because they did, I became hooked on the things. Unfortunately I was never in aposition to be able to touch a computer at school or have any formal training until I put myself through college many years later, then university (Bsc. Soft Eng).
The odd thing is after working with the things for so long, I have long since lost any love of computers, gadgets or programming. I detest the way commercial pressures lead to hacking crappy solutions together. I hate to see C++ that is actually C encased in a few ridiculously huge classes and most of all I hate the mainstream uses of the things these days (ie Marketing, repression, rampant capitalism).
The golden age of computers has passed & now we're into the 'functional magic ' era where technology bloggers can learn a bit of markup and think they understand what programming is like.
tl;dr I liked the old days, things were different when I were a kid.
Shop demo models
If you were messing around with a demo model in WH Smiths then a quick program along the lines of your first image was admittedly tempting:
10 PRINT "<MYNAME> RULES OK"
20 GOTO 10
However this was usually spotted very quickly and a shop floor bod would come over to sort it out.
I preferred the more subtle approach, which for the Dragon in your screenshot would have been:
20 PRINT "(C) 1982 DRAGON DATA LTD"
30 PRINT "16K BASIC INTERPRETER 1.0"
40 PRINT "(C) 1982 BY MICROSOFT"
60 PRINT "OK"
70 GOTO 70
Re: The star trek game
My dad worked for Honeywell (as a CSE) and I can remember sitting in his office (some time in the late 70's) and playing Star Trek on one of his terminals. It was great, and kept me out of trouble, because any time he was actually using the computer I'd send messages to myself via the pneumatic tube system in the building...of course, racing to see if I could 1) actually locate the right office and 2) beat the tube delivery. Of course, since I was 8 (and it was a long time ago) I don't recall ever getting in trouble, even though this was a good sized hospital. I think it did some of the patients good to watch an 8yo kid run down the halls staring at the ceiling and listening for the message canister... ah, happy memories.
If a kid did that today, they'd probably put the entire building under lockdown and call the SWAT team.
Shop Demo Software Shenanigans
A friend of mine had some serious phun with BBC model B's in stores that also sold software.
He would take a box of 5.25 inch floppy disks, all but a few of which was labelled "Watford Electronics Compatibility checker". (Watford Electronics were a third-party supplier of peripherals; they made an improved disk system for the BBC, better than but slightly incompatible with the "official" Acorn upgrade and some software, especially games, would not work with it.)
So my friend would ask to "check" if a game would be "compatible" with his Watford disk system. Inserting the "compatibility checker" disk into the drive of a BBC computer and pressing shift+BREAK produced a fancy screen with a progress indicator; which then asked for the game disk to be inserted, thrashed the drive a bit, then asked for the checker disk again. After a series of such disk swaps came the dreaded announcement that the game was not compatible with the WE DFS. He would return the compatibility checking disk to the back of the box, and ask the shop assistant if he could compatibility-check another game. While the assistant was away fetching it, my friend whipped out the compatibility-checking disk from the front of the box (nobody ever noticed this blatant switch, which was done with no sleight-of-hand) and booted it up.
Again the compatibility-checking process would require several disk swaps, and again it would fail. And my friend would wander off, dejected, before the shop assistant could work out what had just happened right under their nose.