Back to BASIC – the most essential programming language in the history of computing

Share

For someone modern to this strange craft, BASIC seemed almost thaumaturgical. It was spellcasting: you spoke words that animated iron and silicon and made them do things. (As software engineer Erin Spiceland says, coding is “telling rocks what to think.”) If, as I was, you were immersed in Tolkien and other florid 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 tinkering. Unusually for the time, it was an “interpreted” language. With many previous languages, you wrote code, but before you could run it, you had to “compile” it into a miniature packet of ones and zeros. It was a stop-start thing: write, compile, then run. With BASIC, the machine responded immediately. You wrote a few lines, hit RUN, and boom—the machine interpreted it, right there and then.

This turned coding into a conversation with the machine. Programming was like thinking out thunderous. For example, I was working on a chatbot, so I typed a few lines into the parser, then hit RUN to see how it worked. I added a few more lines, observed what worked and what didn’t, then ran it again. This back-and-forth dance with the machine made the whole coding process less daunting. It felt less like I was doing a Very Crucial Project and more like I was just make a fuss. Many of the world’s most popular languages ​​(like JavaScript and Python) are now 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 frosty 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 sent in by hobbyists’ mail. One afternoon, I spent laboriously typing out hundreds of lines of Conway’s “Game of Life,” which I found in an issue, then watched, fascinated, as an artificial organism blossomed on the screen.

There is a saying in the programming world that code is written first for other programmers to read, and only then for a machine to run. BASIC proved this on a grand scale.

But as practical language? For creating shippable software?

BASIC wasn’t always great.

For example, the graphics were glacial. I tried to make a space shooter and it was unplayably snail-paced. This is why so many BASIC game designers focused on text adventures: words, at least, rendered quickly. The explosion of text dungeon crawlers in the Cambrian in the delayed 70s and 80s was partly a product of BASIC’s built-in limitations.

BASIC also had some really unthought-out things. Infamously, it had an hidden GOTO (read: “go to”) command that let you write code that jumped around: if your program got to line 120, for example, you could tell the computer to suddenly jump to line 25.

For a novice programmer, it was an effortless way to write! But it encouraged a intricate “spaghetti” structure, in which the logic bounded and zigzagged in various places. If I wrote a fairly long program—hundreds or thousands of lines—and used dozens of GOTO statements, my code became a labyrinth of mysteries, impenetrable even to me. Computer scientist Edsger Dijkstra hated this style so much that he wrote an entire essay criticizing it: “The Go To Statement Considered Harmful.” Anyone who learned to program in BASIC would, he later wrote, be “mentally crippled beyond all hope of recovery.”

Dijkstra was exaggerating. But he wasn’t entirely wrong: After its heyday, BASIC’s popularity plummeted. Newer languages ​​emerged that encouraged cleaner, more up-to-date writing styles and ran faster. BASIC lives on today—modernized, with GOTO (mostly) banished—in the world of Microsoft Visual Basic, which many noncoding office workers used to put together applications for internal utilize. But only 4 percent of professional programmers now admit to using BASIC. When I started programming again in the 2010s—after a 25-year hiatus—I turned instead to newer languages ​​like Python and JavaScript.

Every now and then, though, I hunt down a Commodore PET emulator. I type in this ur-program I first wrote over 40 years ago and hit RUN.

It still seems magical.

Latest Posts

More News