BASIC
From Maze
10 PRINT is a computer program that operates in a particular way; it does so, in part, because it is written in a particular programming language, BASIC. This "Beginner's All-purpose Symbolic Instruction Code" has an interesting cultural and technical history. BASIC was developed by John Kemeny and Thomas Kurtz, two professors at Dartmouth College; it became operational in 1964 and was freely shared by its creators, leading to its widespread use in education, at the high school as well as college level. By that time, general-purpose computers had been programmed for about two decades and high-level languages had been in widespread use for a decade. While BASIC has important, distinguishing features, it also continues the history of high-level languages, building on what FORTRAN, Algol, and other languages accomplished.
BASIC's invention in an educational context is significant. The language was developed an important early time-sharing environment, the Dartmouth Time-Sharing System. This sort of setup was revolutionary in allowing many programmers to use a single system interactively at the same time. The configuration of such a system, with many terminals connected to a mainframe or minicomputer, was very different from that of the personally owned, inexpensive, single-user computers of the microcomputer era. It was also very different from the batch processing of stacks of punched cards, though. Time-sharing allowed people to engage with and explore computation in significant new ways; BASIC was an important part of this computing revolution.
The story of BASIC became even more interesting as microcomputers came to market and into people's homes. In 1975, the MITS Altair 8800 computer, widely acclaimed as the first home computer, became available. Perhaps the most significant piece of software for this system was Altair BASIC, an interpreter for the BASIC programming language that was the first product of a new company, Microsoft. The alternative Tiny BASIC, developed outside of corporate structures, exemplified the way that recreational programs such as 10 PRINT would be created and distributed. Thanks in large part to Microsoft, BASIC became the lingua franca of home computing. Microsoft's versions of the language were standard on many popular microcomputers and were provided in ROM so that the computer could be turned on and immediately programmed. BASIC reigned in the late 1970s and through the early 1980s, when 10 PRINT circulated on paper and was being keyed in by numerous users. It was obvious at the time that BASIC was the canonical language -- so obvious that some books of BASIC programs do not even find it necessary to mention "BASIC" on their cover.
While the heyday of the language did not last, interesting new versions of BASIC, sometimes radically reformulated, continued to appear. The creators of the original language introduced True BASIC in 1983. In 1985, Microsoft's QuickBASIC offered several innovations and made line numbers optional. Microsoft's even more radically different Visual Basic saw widespread use in creating business applications.
BASIC joins COBOL as one of the major whipping boys among programming languages. Inextricably associated with Microsoft and that bane of structured programmers, GOTO, the language is said to encourage the writing of spaghetti code, to be unbearably slow, and to be suitable only for children and amateurs. Yet many programmers in the early 21st century remember BASIC fondly. The language was a popular success, worked well for small programs that let people explore the possibilities of computing, and fostered creativity and innovation by new categories of computer users.
A Brief History of Programming
There is plenty of dispute about who the first computer programmer is, but many have awarded this designation to Ada Byron, Lady Lovelace. She was brought up by her mother and educated extensively in mathematics and logic so that she might avoid becoming a poet like her father, Lord Byron. (The struggle to keep computation apart from poetics and aesthetics, instead of allowing them to mingle, as they do in 10 PRINT, has a long history.) Her contributions as an early "programmer" are found in her translation of and notes to an Italian article about Charles Babbage's analytical Engine by Louis Menebrea. In this work, completed in 1843, she envisioned the Analytical Engine as a general-purpose computer and described an algorithm that could be used to output Bernoulli numbers. Although the computer Lovelace programmed was never built, and there is evidence that the algorithm in question was originally written by Babbage, Lovelace's project was important to the modern idea of the computer program. This earliest concept of such a program was of an algorithm specified in mathematical notation.
The computer programs that followed in the electromechanical and early electronic age of computing were quite a bit less intelligible, with a much less direct relationship to familiar symbols. The ENIAC, a fully electronic computer which was built at the University of Pennsylvania from 1943 to 1945, was programmed initially by plugging in an elaborate set of cables. [1] To run particular calculations, constants were then set using dials. The next step in programming was the use of machine language. A program in machine language is simply a sequence of numbers. On the ENIAC, these were decimal (base 10) numbers, but different bases were used on other significant early systems. The EDVAC used binary; the ORDVAC, octal; and the BRLESC, sexadecimal. [Fifty years of Army computing by U.S. Army Research Laboratory, p. 62] In all of these cases, programmers needed to arduously determine the sequence of numbers that would constitute a program, writing something that did not look remotely human language at all. Each operation the computer was to perform corresponded to a number, while the operands, if there were any, were provided as similar numbers. For instance, to jump unconditionally to a particular absolute address on the Commodore 64, the opcode "76" (in base 10) is used, followed by two bytes specifying the address.
The first step toward more legible code was seen in the second generation programming languages, assembly languages. Assembly allows the use of mnemonics for operators such as LDA ("load accumulator"), JMP ("jump"), and INC ("increment memory") to stand in for the less easily read underlying numbers. On the Commodore 64, the letters JMP followed by an absolute address are converted by the assembler to "76" in a machine language program. The first assembler ran on Cambridge University's EDSAC, the first stored-program computer, in 1949. [2] Although cryptic compared to a high-level language such as BASIC, an assembler program is nevertheless much more comprehensible than a machine language program. While assembly is still used today in, for instance, programming firmware and in the demoscene, there are usually significant disadvantages to programming at this level. Programming in assembly highlights technical details of platforms and the transfer of values between memory locations and registers. Higher-level languages allow the programmer to concentrate on other matters, such as solving mathematical and scientific problems or mapping programs to business processes.
During the first decade of electronic computing, programming was still crawling toward the ideal of Lovelace's "programs" that specified algorithms in high-level, human-readable form. To reach a level of programming more appropriate for mathematical and scientific tasks, FORTRAN (Formula Translation) was specified in 1954 and first implemented in 1957. This language, and particularly the following version it, FORTRAN II from 1958, was a very strong influence on BASIC. Programming languages were developed for other purposes as well. To address business uses, COBOL was specified in 1959 and implemented in 1960. FORTRAN and COBOL both allowed for more intelligible code, improving on assembly, but both were also developed for the context of batch processing, for use with stacks of punched cards. Specifically, they were developed for what became known as simply "the IBM card," IBM's 1928 punched card that had 80 columns. (As explained in the chapter "Regularity," the Commodore 64's 80-column logical line, which appears as two 40-column lines on the screen, is one legacy of this early material medium for computing.) Programs written in early versions of COBOL and FORTRAN were specific to the punched card in certain ways: COBOL reserved columns 1-6 for the line number and column 7 for a continuation mark if the card's code ran on from the previous one. FORTRAN was similar, with columns 1-5 indicating the statement number. "Comments" (usually the program name) went in columns 73-80 in both languages; a "C" in the first column indicated that the whole FORTRAN card was to be considered a comment. Unless a programmer wrote a one-liner -- which in this case means writing a program that fits on a single card -- a COBOL or FORTRAN program would manifest itself as a stack, often a massive one, of punched cards. These had to be punched on a keypunch machine and fed into a card reader by an operator. Line numbers were of great importance in one particular situation: if someone dropped the stack of cards and they needed to be sorted into order.
FORTRAN's GOTO command was the basis for the GOTO in the original BASIC (MoP p. 86), which of course was carried over into Commodore 64 BASIC. GOTO functions in the same way the assembly language JMP does. There is not much of an advantage to using BASIC if one is simply interested in easily writing JMP, but other BASIC commands, such as PRINT, allow one to very efficiently accomplish what would take very many machine-language operations.
The creators of BASIC were seeking to develop a programming language for the next computing revolution, one that would go beyond punched cards and batch processing to allow numerous users interactive access to a system simultaneously. This revolution was time-sharing.
Dartmouth BASIC and Time-Sharing Minicomputers
In 1962, change was sweeping through the remote Dartmouth campus. Time Magazine noted late that year, in article that declared the college was coming "out of the woods," that the school had built a major new arts center and that John Kemeny, who had made full professor at age 27, had built "the best college math department in the country." [3] That year, Kemeny and his colleague Thomas Kurtz had started developing a time-sharing system and a new programming language for the education of all students at Dartmouth -- not just those studying math, science, or engineering. They aimed to make a radical improvement in access to computers and to computer programming. "While the availability of FORTRAN extended computer from a handful of experts to thousands of scientific users," Kemeny wrote, "we at Dartmouth envisaged the possibility of millions of people writing their own computer programs." (Man and the Computer p. 30)
To reach millions, Kemeny and Kurtz would clearly have to significantly lower the existing barriers to programming, barriers which were related not only to the nature of programming languages but to the material nature of programming. The two began development of DTSS, the Dartmouth Timesharing System, and with it the BASIC programming language. They considered developing a subset of FORTRAN or Algol, but found this unsuitable and set to work, with a team of undergraduates, developing a new language (Masterminds of Programming p. 79). They saw the value of an interactive time-sharing system for allowing users to quickly correct minor errors rather than coming back 24 hours later with a new stack of punched cards for their next scheduled batch job. They also relaxed some of the specific requirements that were tied to using keypunch machines and cards. Kurtz told an interviewer, "we wanted ... to get away from the requirements that punched cards imposed on users, which was that things had to be on certain columns on the card." (Masterminds of Programming p. 81) Oddly enough, spaces between BASIC tokens were optional in Dartmouth's versions of the language, and extra spaces were ignored, because, as Kurtz put it, "some people, especially faculty members, couldn't type very well." (MoP p. 81) This aspect of Dartmouth BASIC was carried over onto the Commodore 64, as mentioned in the introduction.
BASIC was designed in other ways to help new programmers, with "error messages that were clear and friendly" and default options that would satisfy most users' needs (9). "If the expert needs something fancier," Kemeny and Kurtz declared, "let the expert do the extra work!" (11). And, BASIC was meant to be a true high-level language, so that programmers would not need any detailed knowledge of the specific hardware being used.
While BASIC didn't require that programmers put things in certain columns, there was a requirement that something be put at the beginning of each line: A line number, such as "10." This facilitated branching, of course; the GOTO and GOSUB statements refer to the line numbers where program flow should continue. BASIC did not actually need line numbers for this purpose, however. Labels, such as those used in assembly, would have sufficed, and indeed they do suffice in later versions BASIC that do not use line numbers. The line number's real value is seen on a Teletype or other print terminal, or in any environment where full-screen editing is not an option. Line numbers made it easy in those cases to delete existing lines; simply type the line number without any further instructions, and the line disappears. To correct a single existing line, it's possible to simply retype the line with the same line number. To see what a particular line, say line 50, currently is, "LIST 50" will do the trick -- although if one had written the line recently, one could also look up to where the line had been printed out on the roll of paper.
The practice of numbering program statements by multiples of five or ten is not merely aesthetic; the insertion of new lines in a program requires that, as the 1964 manual puts it, "the original line numbers not be consecutive numbers" (22). Numbering a program 10, 20, 30, and so on ensured that between every existing program statement there was room for nine more. It was an acknowledgement that the program is dynamic rather than fixed and perfect. The Commodore 64 User's Guide also advises that "it is good programming practice to number lines in increments of 10--in case you need to insert some statements later on" (33).
DTSS and the versions of BASIC that ran on it served almost all of the students at that college - Kemeny stated in 1971 that 90% of seven classes of freshmen had received computer training. Access to Dartmouth's system extended to many other campuses, and it was not the only time-sharing system with BASIC. By 1965, General Electric - on whose computers DTSS and the original BASIC ran -- was offering a commercial time-sharing service that included BASIC (Waldrop p. 292). Before the microcomputer revolution, other college and university students were taking required courses in computing using BASIC - at NYU's business school, for instance. Even before the arrival of home computers with built-in BASIC, the language had extensive, if not pervasive, influence. And even before the microcomputer era and the full toppling of BASIC's Tower of Babel, the permissive attitude of Kemeny and Kurtz had led to many different implementations of BASIC for different systems. Writing in 1975, one author commented: "BASIC systems differ among themselves in much the same way that the English language as we know it differs among the English-speaking nations around the globe." (Mullish p. 6)
While BASIC was a significant project at Dartmouth, it was only one part of the push to expand access to computing that resulted in DTSS, allowed sites all around the East Coast to connect to Dartmouth's computers, and fostered a more productive and creative relationship to computing. In his book 1972 Man and the Computer, he defends programming and playing games and other "recreational" uses of the computer as important, writing that such actrivities are relaxing and help people to overcome their fear of computers (p. 35). Kemeny also described some of the context in which BASIC programming was done at Dartmouth: "The computation center is run in a manner analogous to Dartmouth's million-volume open-stack library. Just as any student may go in and browse the library or check out any book he wishes without asking for persmission or explaining why he wants that particular book, he may use the computation center without asking permission or explaining why he is running a particular program." (Man and the Computer p. 33) It was not only the BASIC programming language, but also the development of this permissive attitude toward computing that allowed for programs with no obvious military, business, or scientific purpose -- such as 10 PRINT -- to come about.
So, while home computing provides a significant context for the program at the center of our discussion, computer had become more welcoming and available for a wider variety of uses, even before they moved into the home, thanks in part to BASIC.
Altair BASIC and Micro-Soft
The computing revolution after time-sharing would change industry and reshape everyday interactions with computing. It was the beginning of the home computer or minicomputer era, and the face that launched a thousand ships was a panel of switches and LEDs on the cover of the January 1975 Popular Electronics. The image was of the Altair 8800. This $395 machine ($495 assembled) was described consistently there and throughout the magazine as a "minicomputer," rather than a "microcomputer." The article about this device also describes the many virtues of a useful computer for individuals and the headline of the editorial on page 4 clearly proclaims "THE HOME COMPUTER IS HERE!" Popular Electronics was founded in 1954 by Ziff-Davis Publications and was a well-known, widely-distributed magazine by 1975. The year did mark an inflection point for home computing and for the magazine, which came to focus increasingly on computing. In November 1982, it would be renamed Computers & Electronics.
The article describing the Altair 8800 claims that the computer can be used as a "Sophisticated intrusion alarm system," an "Automatic IC tester," an "Autopilot for planes, boats, etc.," a "Time-share computer system," a "Brain for a robot," and a "Printed matter-to-Braille converter for the blind," among other things, noting that "many of these applications can be performed simultaneously." (p. 38) As it happened, even the applications that were within the capabilities of the device were rather difficult to realize since the system, as delivered or assembled, could only be programmed in machine language. Unless one happened to have a Teletype or other terminal lying around, the programming had to be done using the toggle switches on the front panel. From the outset, it was clear to many that the Altair 8800 could really use was a programming language that facilitated experimentation. The Popular Mechanics article actually mentions four programming languages by way of explaining the hardware/software distinction (p. 34); one of these is BASIC, which was the language of most interest to early Altair 8800 users.
The two major successful efforts to develop a BASIC interpreter for the Altair are important and intriguing. While this tale of two BASICs doesn't clearly show the best of BASIC and the worst of BASIC, they do show two extremes in software development: one commercial, closely coordinated with hardware manufacturers, and highly tied to licensing and cost structures; the other community-based, non-profit, and "copyleft." The BASICs that led in these directions were Microsoft's Altair BASIC, the official BASIC for the platform, licensed to the manufacturer of the system, MITS; and Tiny BASIC, which originated at the People's Computer Company or PCC. The Commodore 64's BASIC is directly descended from Microsoft's Altair BASIC -- it is, although this is not visible on the startup screen, a Microsoft product. At the same time, the 10 PRINT program participated in a context of BASIC sharing and exploration that was strongly influenced by the People's Computer Company.
The story of Microsoft BASIC, and of Microsoft, begins with Paul Allen catching sight of the now-famous Popular Electronics, reading about the Altair 8800 in it, and showing the article to his friend and business partner Bill Gates. The two had already earned some limited success when Gates was still in high school. Their first venture was called Traf-O-Data and produced hardware and software to count cars. They programmed the Intel 8008 using a simulator running on a Washington State University mainframe.
By 1975, Gates was at Harvard University and he and Allen were ready to envision a project with broader reach. They devised the idea of writing BASIC for the Altair and contacted Ed Roberts' company MITS to ask if they would be interested in a BASIC for their system. As with their Traf-O-Data system, they initially programmed on a university's computer system using a simulator. What they were programming at this point was, of course, a modified and minimized version of the original 1964 BASIC. Given how often the success of personal computing software is attributed to entreprenurial and business advances and to Microsoft in particular, it's remarkable that Microsoft's first product was developed using Harvard's computer and was an implementation of Dartmouth's programming language.
Gates and Allen were successful in fitting their BASIC interpreter into an austere 4KB and leaving some room for a BASIC program. Allen flew to visit MITS in Albuquerque, taking the program on paper tape. The demo was a success and was licensed by MITS; Gates and Allen moved to New Mexico to create new versions of BASIC for the Altair and to maintain the original code.
In the book Invisible Engines, three authors develop of a theory of how software platforms can be two-sided (or multi-sided) in the sense of two-sided markets. In a predominantly one-sided market, such as a swap meet where people arrive with comics to trade, there is only one class of participant, a person interested in exchanging goods with other people. A classic land-line telephone company is also in a one-sided market, since every customer is more or less the same sort of participant, one who wants to make and receive calls. On the other hand, a credit card company has two different classes of customer: merchants, who receive payments and need terminals, and cardholders, who have a line of credit and who make purchases.
When Atari released the Atari VCS (later called the Atari 2600) in 1977, before the advent of third-party games, it had a one-sided platform. Atari made the system and (initially) all the games and controllers. The only participants in the market, and users of the platform, were the players. By the early 1980s, when Activision, Imagic, and other third-party companies had come into the market, there was another class of participant -- one that was not paying royalties to Atari for the privilege of making games for their console.
Microsoft's Windows is one example of an (at least) two-sided platform. On one side, computers need an operating system and desktop environment to function. This leads hardware manufacturers such as Dell to purchase licenses to Windows and to include the software with their systems. On the other side, computers are only valuable if there are applications written for them. Microsoft writes some of the applications for Windows, but third-party developers write many. The abundance of software has a network effect that is positive for Microsoft: it encourages users to stay with Windows. And, since Windows is preinstalled on many computers, companies want to write applications for it.
Of course, Windows was not the first two-sided platform, nor even Microsoft's first. By retaining the rights to what IBM called PC-DOS, Microsoft had previously been able to license MS-DOS to other companies, much as they would later sell OEM copies of Windows to them. And before that, there are continuities with the company's first product line, Microsoft BASIC. BASIC was a programming language, not an operating system, but the presence of BASIC allowed for programs to be written on a computer and sometimes sold. There were two sides to BASIC: The computer companies, beginning with MITS, who wanted it on their machines and the computer hobbyists who wanted to write (and in many cases sell) BASIC programs. At Gates and Allen's company, the success of BASIC and the essential business plan used with that family of software products helped to develop the later success of MS-DOS and Windows.
BASIC continued to develop and diverge as it came into the home. To allow programs to be written more compactly, Microsoft's Altair BASIC introduced the colon (:) as a separator of statements on the same line, so that one could write lines such as:
160 R=16:PRINT"HOW MANY DECKS (1-4)";
This feature was missing from minicomputer BASICs and the ANSI standard, and Kemeny and Kurtz saw it as potentially confusing rather than helpful. When they released their much-revised True BASIC for home computers in 1983, it did not allow multi-statement lines. The colon is, however, important to 10 PRINT; this program could not be written as a concise one-liner without it.
Tiny BASIC and Copyleft
In 1975, another BASIC was developed for the Altair thanks to volunteer programmers and the nonprofit People's Computer Company (PCC). Bob Albrecht, who had founded "probably the world's first completely free, walk-in, public computer center -- People's Computer Center -- in a storefront in Menlo Park, California" (Dr. Dobbs @ 30) was one of many, along with Paul Allen, who had seen the Popular Electronics cover story on the MITS Altair. He discussed it with Dennis Allison, who taught at Stanford, and Allison began to develop a specification for a limited BASIC interpreter called Tiny BASIC. In a collaborative hobbyist spirit, Allison's documents were published by Albrecht in three parts in issues of the PCC newsletter, a serial which had been running since October 1972. At the conclusion of this Allison's series of specifications, Allison called for programmers to send in their implementations and offered to circulate them to anyone who sent a self-addressed stamped envelope.
The first interpreter written in response to this call was by Dick Whipple and John Arnold and was developed in December 1975. To disseminate it, Albrecht and Allison decided to start a new serial, initially photocopied and originally intended to just run for a few issues. This was Dr. Dobb's Journal of Tiny BASIC Calisthenics and Orthodontia, which printed the code for the interpreter in octal machine language, ready for hobbyists to toggle in or (hopefully) key in on their Teletypes. It would be an understatement to call this publication a success. By January of 1976 the journal title was made more general by removing the explicit mention of Tiny BASIC, an editor was hired, and Dr. Dobb's launched as a newsletter offering code and articles on computing topics. The journal still exists online. It ran as a print publication until 2009, and shortly before that had a circulation of 120,000. In 1985, Dr. Dobb's published Richard Stallman's "GNU Manifesto."
[More on Tiny BASIC, the canonical version 4, copyleft, etc.]
The Ethic vs. The Corporation
In his very popular book Hackers: Heroes of the Computer Revolution, Steven Levy describes the early history of home computing and the development of BASICs for the Altair and its immediate successors as a confrontation between an ethic of openness and sharing with the sort of corporate powers that were "a foe of the Hacker Ethic." (p. 227)
This portrayal has helped to set up what is often remembered as the first major clash between free software and the corporate force of Microsoft: the "Open Letter to Hobbyists." Bill Gates wrote this confrontational letter in February 1976, declaring: "As the majority of hobbyists must be aware, most of you steal your software." It ran in the Altair Users' Newsletter as well as the newsletter of the Homebrew Computer Club. The letter spurred hundreds of responses, public and personal, causing the major early controversey in home computing.
There are a few complications to the most popular version of this clash, and to simplistic assignment of good and evil roles, just as there are complications in considering Altair BASIC as the absolute bad guy when compared to TinyBASIC.
For one thing, neither Microsoft, Gates, or Allen is the party fingered in Levy's book as the "foe." That moniker is attached to Ed Roberts, the head of MITS, who was running a business with dozens of employees, many of whom would be around furiously working at any given hour to fulfill computer hobbyist's orders (and their dreams of computer ownership). "Micro-Soft" (the spelling had not been regularized by the time of the first letter) was at the beginning of 1976 simply two partners, both recent college drop-outs, one a teenager and other only slightly older. The company had hired other people, such as BASIC contributor Monte Davidoff, to work on projects, but it would not gets its first official employee until April 1976.
Copyright protection for computer programs, which Gates based his argument upon, was well-established by 1976. While sharing of programs certainly happened in users' groups and other contexts, today's concept of free software had not been articulated by that time. Richard Stallman started the GNU project in 1983 and published the GNU Manifesto and founded the Free Software Foundation in 1985, a decade after Altair BASIC. An argument has been made that, even though this discourse has been overlooked, some of the ideas important to the free software movement were first publicly stated in the columns of magazines and newsletters in response to Gates's letter. (Driscoll) But many hobbyists were not interested in free (as in freedom) software as conceptualized today; rather, they were interested in (as the editorial in the first issue of Dr. Dobbs explained) "free and very inexpensive" software.
Gates wrote a "Second and Final Letter," replying to several objections raised to his first letter. In it, he went on to admit that, at least for certain types of programs, the free sharing of code is likely to become the norm. He even suggested that good "compilers and interpreters" (such as Microsoft's Altair BASIC) will enable such shared software:
In discussing software, I don't want to leave out the most important aspect, vis., the exchange of those programs less complex than interpreters or compilers that can be written by hobbyists and shared at little or no cost. I think in the foreseeable future, literally thousands of such programs will be available through user libraries. The availability of standardized compilers and interpreters will have a major impact on how quickly these libraries develop and how useful they are.
Gates and Microsoft certainly had a concept of software that would allow for it to be sold and tightly controlled by a corporation, but they were hardly seeking to eliminate hobbyist programming and the sharing of code. The company's principles did oppose the ethic of the Homebrew Computer Club and the People's Computer Company in significant ways, but Microsoft ended up accomplishing some good with BASIC and facilitating the exchange of programs that Gates mentioned. Through licensing deals with computer companies, they did a great deal to bring BASIC not only out of the timesharing environment but also beyond the hard core of code-sharing enthusiast programmers.
Ultimately, BASIC became what it was in 1982 thanks to the institution of higher education where it was first developed, the corporation that implemented it and licensed it for use on home computers (including the Commodore 64), and the hacker ethic of code sharing.
Commodore BASIC
Circulating Programs in Print
BASIC programs, from the inception of the language, circulated as ink on paper. In 1964 and the years following, there was no Web or even Internet to allow for the digital exchange of programs, and it was often impractical to distribute programs on computer-readable media such as paper tape. Some insights can be gained by considering the specific forms of printed matter that were used to communicate BASIC programs, which show signs of the practices BASIC users developed, the habits they fell into, the culture that developed among them, and the trends they set that continue to inflect the history of computing.
From the mid-1970s through the early 1980s, BASIC was known in print not only through manuals and books that explicitly taught and specified the language; it was also known through collections of programs that appeared in magazines and in books.
MAGAZINES
By the 1970s, the practice of turning to electronics and computer magazines was common. Ziff-Davis’s Popular Electronics, launched in 1954, became perhaps the first broadly available computer magazine. It developed a strong following among computer specialists and hobbyists alike, and because of its success was only the first of Ziff-Davis’s magazines about computer technologies over the next five decades. In the early 1970s the magazine’s format grew to letter-size (8.5 x 11 in), and the magazine’s tagline "World's Largest Selling Electronics Magazine" would grace its cover. Many claim that the image of the new Altair computer on the January 1975 issue of Popular Electronics triggered the age of home computing. Not even a decade later, in November 1982, Popular Electronics was renamed; under the name Computers & Electronics, the magazine reviewed hardware and software products.
During that same decade, spurred by the growth of home computing as well as nurturing it, many other computer magazines came and went. Several, however, are worth mentioning here because they trafficked in BASIC and catered to BASIC learners and aficionados alike – namely Byte, Commodore Magazine, Creative Computing, Run, Rainbow, and Dr. DOBBS. These magazines, which themselves changed over the years, offer a window into the range of BASIC users and programs as well as reviews and discussion of new hardware and software that be and remain of interest to BASIC-using communities.
Creative Computing was an early magazine in the world of micro-computing. Founded by David H. Ahl, who also wrote some ground-breaking books [later], Creative Computing focused on publishing for the home computer hobbyist; launched in 1974, it survived until 1985. Run was a monthly magazine published by IDG Communications that didn’t start publication until 1984 and devoted itself to all things Commodore. There was also a German edition on RUN. Rainbow Magazine was a monthly magazine for the TRS-80 Color Computer, and it was published from July 1981 to May 1993. Rainbow featured "Rainbow on Tape" and "Rainbow" on Disk services to supplement the type-in programs the magazine offered. The offerings of the magazines included type-in programs, recipes, and math games. Byte was a monthly magazine with wide-ranging coverage that appeared first in September 1975 on the heels of the early personal computers manufactured and sold as kits. It survived under several owners until 1998.
BOOKS
Almost every book transmitting information of BASIC in the 1970s could be characterized as educational — that is, they explained, illustrated, and provided code for applications that users could enter, test and alter.
David H. Ahl's compilation, 101 Basic Computer Games, was first published in 1973 by the Digital Equipment Corporation (DEC). Though not the first book of computer games, it was the first to collect only games in BASIC. It contains a listing of games, a sample run of each game, and usually a short description of each game. It also acknowledges each game's author(s) and lays out other sources if the game has been transformed from a previously known game. The program's "computer limitations" are also described so users understand the hardware requirements. Illustrations, courtesy of Mad Magazine among others, punctuate the presentation, usually between this modicum of contextual information and the program's listing. The game's titles are abbreviated into names that are no longer than six characters long -- e.g. ACEYDU for "Acey Ddeucy CArd Game"; AMAZIN for "Draw a Maze"; or POET for "Random Poetry (Haiku)." The book's table of contents comprises three columns: a list of game name tags in alphabetical order, a column bearing a single-line description of the game, and a page number where the game's actual title accompanies the game's name tag along the top of the page. The book’s preface makes a point of teasing out the educational value of games, the need for “unguided learning,” especially if one considers the value of creating games, not just playing them. The games in this book were submitted for compilation by many authors.
As we learn in the Preface of the January 1978 edition of the book published by Ahl's Creative Computing Press, David H. Ahl left DEC in 1974. Despite his departure, DEC continued to publish its version, but without Ahl's name on it. The first printing of Basic Computer Games, Microcomputer Edition in January 1978 reflects the fact that, at the time of the DEC publication of 101 Computer Games, microcomputers hadn't been manufactured yet, and programmers using the BASIC language were still running code on time-sharing machines or on minicomputers.
The preface of Basic Computer Games, Microcomputer Edition differs significantly from the DEC edition. It is newly conceived and re-written. With this edition, the goal appears to be to spell out the value of games within broader contexts. The preface begins with a dictionary definition of the word “game” (though without naming the dictionary). It then provides a cursory history of sports and games moving from the ancient Chinese and Egyptians to the 1970s in little more than a paragraph and a half, only to emphasize that games offer recreational, breaks “from the “realities of life,” and also have other “important redeeming virtues.” The next two sections of the preface emphasize games as an educational tool and computer games in particular. The Preface also explains to users that the programs in this book all run on MITS Altair 8K BASIC, Rev. 4.0. Some new programs replace those that were deleted because they “could not be converted or weren’t worth converting to MITS BASIC.“ (p. ix)
This first non-DEC printing drops the game's name tags. Instead it uses the game's title in the table of contents, which is no longer organized alphabetically, but rather by game category -- e.g. Introductory Fun; Educational; Plotting and Pictures; Number and Letter Guessing; Remove an Object; Matrix Manipulation; Logic; Space; Sports Simulation; Gambling Casino; Card and Board; Combat; etc.), helping aficionados of certain types of games gain easier access to them.
No doubt aware of the momentum building in the growing community of users of the BASIC language, Ahl encourages his reading programmers to submit games for publication in books and future issues of his magazine, Creative Computing. He urges those who wish to submit programs to “Please send the following: program listing, one or two sample runs, descriptive notes, paper tape and self-addressed stamp envelope. The listing and run should be on white, unlined paper and should be done in fresh black ribbon. The paper tape should be wrapped in kitchen plastic wrap or aluminum foil to prevent oil seepage from damaging other enclosures. The descriptive notes should be double-spaced.”
Still in 1978, Workman Publishing takes on further publication of Ahl's evolving compilation under the title of Basic Computer Games, Microcomputer Edition. 101 Great Games to Play on Your Home Computer. By yourself or with others. Each complete with programming and sample run. The lengthy title arguably reflects the publisher's attempt to reach always for broader audiences. It further translation into German, as Basic-Computer-Spiele Bd. 1. 101 fantastische Spiele für Ihren Mikrocomputer in BASIC geschrieben mit Listing und Probelauf, in 1982 (and reprinted in 1983) also suggests that the apparatus of a major publisher helped disseminate games in BASIC abroad.
There were other paths used to disseminate BASIC in books. According to Wikipedia, Bob Albrecht's What To Do After You Hit Return, or P.C.C.’s first book of Computer Games was first published in 1975 by People's Computer Company. It was handed off to a series of other publishing entities and underwent several printings. Hayden Books began printing it in 1977; its 5th printing in 1979 was still printed inexpensively on newsprint paper.
Given the growing popularity of BASIC and computers among hobbyists, it is not surprising to see other, even simpler presentations of BASIC such as The Little Book of BASIC Style. How to write a program you can read, which was written by John M. Nevison (and self-published by John M. Nevison Associates, 1978) and seeks to echo the simplicity of the Elements of Style by E. B. White, whom the author invokes in his Preface.
On the other hand there are introductions to BASIC that make extensive use of BASIC as the language of choice: Programming for Poets. A Gentle Introduction Using BASIC, written by Richard Conway and James Archer and published in 1979 by Winthrop Publishers of Cambridge, MA., which is a simplified textbook; and BASIC With Style. Programming Proverbs by Paul Nagin and Henry F. Ledgard (Hayden Book Co., 1978). Among these are also more typical textbooks.
While many early books about BASIC are about pursuing hobbies (and games in particular), we would be remiss not to mention the types of books that help people organize their lives and keep their small businesses afloat. Charles D. Sternberg’s BASIC Computer Programs for the Home (1980) is one such book, whose specific aim was to satisfy “the practical requirements of the home.” The author wishes to address the user's desire not to “rely upon the availability of tape or disk-storage devices or any other features that may not be easily come by" and encourages the “modification of these programs to utilize features of your particular machine should present few difficulties." The programs in this book were tested on An Altair 8800b Microcomputer system. The author offers many reassurances of the ease with which programs can be entered, run, used, and even changed. Besides providing home financial programs, for example, and such “kitchen helpmates” as programs to convert recipe quantities, to plan meals according to various diets, to inventory your freezer’s contents, etc., this book provides descriptions of the purpose and functions of each program as well as some details about data entry, outputs, and other commentary. In the introduction the author explains that he eschews “highly efficient routines” in favor of increased “clarity” and a “modularity” which lends itself to easier alteration.
If 1977 and 1978 seem to be turning points in the explosion in the print transmission of BASIC, there are in the early 1980s more and more books about BASIC, in its many tweaked flavors, published explicitly with niche audiences in mind, as illustrated by Sterberg's book as well as Zuanich & Lipscomb's BASIC Fun with Graphics the Apple Way" and "BASIC Fun with Graphics the IBM/PC Way" (both Avon Books, 1983) for children.
BASIC Code in Human Memory
In today's computing context, it is hard enough to remember programs being transmitted on physical media such as floppy disks and cassette tapes. The notion that programs would routinely be published in print and typed by users is even more alien, but we do have material evidence that programs were transmitted in this way, and people are still invited to key in code snippets of different sorts from books on programming.
There is an even stranger way that programs, particularly short ones such as BASIC one-liners, got from computer to computer and from person to person: By being memorized. The claim here is not that the early 1980s presented a Fahrenheit 451 situation in which the world's great computer programs were preserved by a dedicated few, but that it was common for people who knew a bit of programming to keep a one-liner, or even a handful of short programs, in mind so that they could be typed into a friend's computer. Very short programs that did visually interesting things were particularly worth memorizing. And since programmers typically had to memorize certain BASIC statements, such as ? CHR$(147) (which clears the screen), it was not much of a leap to memorize two statements, such as 10 PRINT CHR$(205.5+RND(1)); : GOTO 10.
The dream of having total recall of a massive computer program manifests itself in science fiction. In Cory Doctorow's story "0wnz0red," the main character, Murray, is initially a fat slob who, after the death of his only friend Liam, has spiraled downwards personally and in terms of code quality. After Liam returns, having actually hacked his body and mind into near-perfection, Murray is provided with similarly superhuman abilities, including the ability to exactly remember large amounts of English text: "... generating a 4,096 bit key that he could remember was going to be damned hard, but then he closed his eyes and recalled, with perfect clarity, the first five pages of documentation he'd written for the API. His fingers rattled on the keys at speed, zero typos." The keyboard isn't essential to this process: Later, while hooded and being interrogated, Murray recites the entire key.
In the culminating moment of "0wnz0red," it is revealed that while Murray apparently can't easily memorize a random sequence of characters, his powers of recall extend beyond human language: "once he had the laptop open and began to rekey the entire codebase, the eidetic rush of perfect memory dispelled all his nervousness, leaving him cool and calm as the sun set over the Mission." Murray is human enough that he cannot recall an arbitrary 4KB, but enough of a savant that he can perfectly remember documentation that he wrote -- and, as is dramatically revealed, he's also an extreme enough programmer that he can retype the code he and Liam developed together.
Doctorow's story makes it clear that the ability to memorize a large program is a superpower; that is, it is not an ordinary human ability and it is also an ability that is awesome, desirable, and elite. At the same time, the story's treatment of the human body and mind as comptuerlike, as capable of being mastered by a programmer and owned (or even 0wnz0red) by an adversary, is consistent with the idea that memorizing code is slaving one mind's to the machine, treating it as a storage peripheral.
The idea that a page of code is easier to memorize than a random page of characters is supported by experimental studies. In an effort to better understand how people comprehend computer programs -- which has ramifications for programmer efficiency -- studies of program memorization were undertaken beginning in the mid-1970s. In 1976 Ben Shneiderman reported a statistically significant difference between subjects of different ability levels attempting to memorize a Fortran program and a series of valid Fortran statements in scrambled order, "leading us to the conclusion that the structure of a program facilitates comprehension and memorization." (p. 127) Part of the motivation for this study was the cognitive psychology literature on remembering sentences.
Ruven Brooks published a more elaborate theory of program comprehension in 1983; 10 PRINT shows some interesting ways in which this theory breaks down. In Brooks's theory, a programmer reconstructs knowledge about the real-world domains that the program models, developing an initially underspecified hypothesis and refining and elaborating it "based on information extracted from the program text and other documentation." (p. 543) Brooks posited the useful idea that certain lines were "beacons," specially indicating program structures and operations. (p. 548) But his theory is otherwise difficult to apply to 10 PRINT. Brooks lists seven internal and five external "indicators for the meaning of a program," such as "Indentation or pretty-printing" and "Flowcharts." (p. 551) None are present for the one-line program we are discussing here. More fundamentally, Brooks's model is for programs that simulate business processes, not computer programs in general. He introduced a shipping domain in his paper, but then noted that "If the task is to implement a general algorithm for a general purpose routine, say a matrix inversion subroutine, there will be no domain corresponding to the original domain of cargoes and routes." (p. 545) In fact, the problem is not just with abstract processes and mathematical routines. Brooks's model cannot directly apply to any creative production that is done by programming the computer, unless it happens to also have a business-style real-world domain. What is the "cargoes and routes"-style domain of games, recreational programming, art, music, obfuscated code, or productions such as demos and intros in the demoscene?
Brooks's concept of beacons was used in another memorization study by Susan Widenbeck, published in 1986, in which a comprehension model with top-down and bottom-up aspects was introduced. Widenbeck found that beacon lines were recalled more often by experienced programmers. She also noted, "Memorizing a program is a very unusual programming task, and it is possible that it changed the subjects' normal program comprehension strategies and procedures." (p. 705) She found that program memorization was not like the memorization of text: "If subjects were taking a strictly linear, or text-reading, approach to understanding the program, we would expect the lines near the beginning of the program to be better remembered ... this was not the case." (p. 707) At the same time, she made analogies to the reading of texts in describing how her subjects read programs: "Using beacons to understand a program seems to be something like skimming an English text. They help to figure out the general, high-level function, but they do not contribute to a detailed understanding of the code ..." (p. 708)
Shneiderman's early acknowledgement that programs can be memorized is significant; his result, furthermore, shows that the memorization of programs relates to the memorization of language in some important ways. But there are differences between this study's perspective and the consideration of how BASIC one-liners are memorized. Shneiderman focuses on comprehension and uses memorization as a measure of comprehension; although it seems evident from all of these studies that two are deeply connected, memorization is nevertheless being considered along the way to understanding something else. Shneiderman's study is about the short-term memorization of programs of about 20 lines, assigned as a task. Because short-term memory is the concern, Shneiderman cites the famous paper on the topic, Miller's 1956 "The magical number seven, plus or minus two," and discusses how his results may be consistent with the ones in that paper.
The point here is not to advance an alternative theory of program memorization, but to show that 10 PRINT represents a category of programs that were historically memorized but which existing theories of program memorization, created for longer program and for programs that model business processes, do not cover. The memorization of BASIC one-liners was rather long-term, was done for fun, and of course involved very short programs. This type of memorization will have certain things in common with the type done in these memorization studies, but it may also relate to the way people memorize jokes, proverbs, and other folk texts. These studies do at least show how people can remember key statements (beacons) and the high-level workings of a program without memorizing it character by character. Also, the appearance of program variants that work identically but are written differently is consistent with studies on and theories of program memorization. And, essentially, the studies demonstrate that program memorization is possible and that many people may have carried 10 PRINT into a Commodore 64's memory using their own.
Sidebar: Remembering 10 PRINT
When I first wrote about a similarly-functioning program, I presented this version: 10 PRINT CHR$(109+RND(1)*2); : GOTO 10. That's the program I discussed very briefly in my article "Obfuscated Code" in Software Studies: A Lexicon, and that's the same text I presented to Mark Marino's online Critical Code Studies Workshop, where it sparked the discussion that led to this book. It does the same thing as our title program, for two reasons: First, 205 and 206 are mapped to the same characters as 109 and 110; second, adding a random number between 0 and 2 does the same thing, due to rounding, as adding .5 and adding a random number between 0 and 1. The version we are using in the title of this book is based on (although not identical to) two early print sources for the program, the three-line program in the Commodore 64 Users Guide and the one-line version in RUN Magazine. There are no print sources from the 1980s that we have found that use "RND(1)*2" or that use 109 and 110 rather than 205 and 206.
Why did I initially bring up this "corrupt" version of the program? Simply because I reconstructed 10 PRINT from memory and looked at a chart of "PETSCII" characters values when I was doing so. Since 109 and 110 are lower numerically and closer to the values for the characters A-Z, I found them first in the manual and used those values.
Our discussion of this program is based on the print versions of it that I found early in the process of working on this book -- but the version of the program that started our discussion came from my memory.
-Nick Montfort
Works Cited
Anon. 1982. Commodore 64 User’s Guide. Wayne PA; Indianapolis, IN: Commodore Business Machines; Distributed by Howard W. Sams & Co. http://www.commodore.ca/manuals/c64_users_guide/c64-users_guide.htm.
Brooks, Ruven. "Towards a theory of the comprehension of computer programs." International Journal of Man-Machine Studies 18. pp. 543-554. 1983.
Doctorow, Cory. "0wnz0red." Salon.com. August 28, 2002.
Kemeny, John G., and Thomas E. Kurtz. 1985. Back to BASIC: The History, Corruption, and Future of the Language. Addison-Wesley.
Levy, Steven. Hackers: Heroes of the Computer Revolution. New York: Dell. 1984.
Shneiderman, Ben. "Exploratory Experiments in Programmer Behavior." International Journal of Computer and Information Sciences, Vol. 5, No. 2., 1976, pp. 123-143.
Widenbeck, Susan. "Beacons in computer program comprehension." International Journal of Man-Machine Studies 25. pp. 697-709. 1986.
