For someone new to this strange craft, BASIC was downright thaumaturgical. It was like casting spells: You spoke words that brought iron and silicon to life and made them do things. (As software engineer Erin Spiceland puts it, coding is “telling rocks what to think.”) If, like me, you were steeped in Tolkien and other flowery high fantasy novels, there was a deep romanticism in the idea that everyday language could affect reality. Speak, my friend, and come in.
BASIC also encouraged experimentation. It was an “interpreted” language, which was unusual at the time. In many earlier languages, you wrote the code, but before you could run it you had to “compile” it into a little package of 1s and 0s. It was a slow process: write, compile, then run. With BASIC, on the other hand, the machine responded instantly. You typed a few lines, hit RUN, and boom! The machine interpreted it right away.
This turned coding into a conversation with the machine. Programming was like thinking out loud. For example, I was working on a chatbot, so I would enter a few lines into the parser and then hit RUN to see how it worked. I would add a few more lines, see what worked and what didn’t, and then run again. This back-and-forth dance with the machine made the whole coding process less intimidating. It seemed less like doing a very important design and more like just PlayingMany of the world’s most popular languages (such as JavaScript and Python) are now also interpreted on the fly, but BASIC was one of the first.
BASIC also created the world’s first mass open-source culture. People shared code freely: if a friend wrote a cool blackjack game, we’d all make a copy (by hand, like scribes in medieval monasteries) and run it ourselves. Every month, Compute magazine printed reams of BASIC mailed in by hobbyists. I spent an afternoon laboriously typing out hundreds of lines of Conway’s “The Game of Life” that I’d found in one issue, then watched, mesmerized, as an artificial organism blossomed on the screen.
In the programming world there is a saying that code is written primarily to be read by other programmers and secondarily to be executed by the machine. BASIC demonstrated this on a grand scale.
But as a Practical language? For creating deliverable software?
BASIC wasn’t always great.
The graphics, for example, didn’t work well. I tried to make a space shooter, and it was too slow to play. This is one reason why so many BASIC game developers focused on text adventures: words, at least, processed quickly. The Cambrian explosion of text-based dungeon-crawling games in the late 1970s and 1980s was partly a product of BASIC’s built-in limitations.
BASIC also had some truly inconsiderate elements. Infamously, it included the GOTO command (read as “go to”). This allowed you to write code that jumped from one line to another: if your program reached line 120, you could tell the computer to suddenly jump to line 25, for example.
For a novice programmer, this was an easy way to write things! But it encouraged a complex “spaghetti” structure, where logic was bounded and zigzagged all over the place. If I wrote a long program (hundreds or thousands of lines) and used several dozen GOTO statements, my code would become a labyrinth of mysteries, impenetrable even to myself. Computer scientist Edsger Dijkstra so detested this style that he wrote an entire essay railing against it: “The Go To statement is considered harmful.” Anyone who learned to program in BASIC would be, as he later wrote, “mentally crippled beyond hope of regeneration.”
Dijkstra was exaggerating, but he wasn’t entirely wrong: After its heyday, BASIC plummeted in popularity. Newer languages emerged that encouraged cleaner, more modern writing styles and ran faster. BASIC is still alive these days (modernized, with GOTO (almost) banished) in the world of Microsoft Visual Basic, which many non-programming office workers have used to cobble together applications for internal use. But these days, only 4 percent of professional developers admit to using BASIC. I, when I started programming again in the 2010s (after a 25-year hiatus), turned to newer languages like Python and JavaScript.
From time to time, however, I look for an emulator for the Commodore PET. I type in the original program that I first wrote, over 40 years ago, and hit RUN.
It still feels like magic.