BASIC
From Maze
10 PRINT operates in a particular way. The graphical symbols on the screen, the way they line up in rows and then in columns, and even the speed at which they appear -- these characteristics all contribute to the program's overall aesthetic. 10 PRINT functions this way in part because it is written in a specific programming language: BASIC.
This "Beginner's All-purpose Symbolic Instruction Code" has a fabled cultural and technical history. BASIC was developed by John Kemeny and Thomas Kurtz, two professors at Dartmouth College. In 1964 its creators freely shared a working version of the language, leading to its widespread adoption, both at the high school and college level.
By that time, general-purpose computers had existed for about two decades. Many were still programmed in low-level machine languages, but high-level languages, abstracted from the idiosyncrasies of an individual machine, had also been in widespread use for a decade. While BASIC had its own distinguishing features, it also continued the history of high-level languages, building on what FORTRAN, Algol, and other languages had accomplished: a more natural syntax, easier use, and greater portability across platforms.
BASIC's invention in an educational context is significant. The language was developed for an early time-sharing environment, the Dartmouth Time-Sharing System (DTSS). This revolutionary configuration allowed multiple programmers to use a single system at the same time. A system of this sort -- with many terminals connected to a mainframe or minicomputer -- differs considerably from the personally owned, relatively inexpensive, single-user computers of the microcomputer era. But in the early 1960s, the DTSS also distinguished itself from earlier systems that required the batch processing of stacks of punched cards. Time-sharing allowed people to engage with and explore computation in significant new ways, with what felt like "real time" processing; BASIC was an important part of this computing revolution. Given the educational purpose of DTSS and BASIC, ease of use was paramount. And being easy to use helped lead to BASIC's massive popularity and success.
BASIC became even more influential as microcomputers entered 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, a version of BASIC that was the first product of a young company called Microsoft.
Following its success with the Altair 8800, Microsoft wrote versions of BASIC for many popular microcomputers. Thanks in large part to Microsoft, BASIC became the lingua franca of home computing. BASIC resided in the ROM of these computers, meaning a user could turn on the computer and immediately begin programming. From the late 1970s through the early 1980s, BASIC reigned supreme on home computers, with 10 PRINT and thousands of other programs circulating through books, magazines, and computer club newsletters. BASIC was so canonical that some books of BASIC programs did not even bother to mention "BASIC" on their covers.
While the heyday of BASIC has long past, new versions, sometimes dramatically reformulated, have continued to appear. The creators of the original language introduced the structured 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, released in 1991, has been widely used to create business applications.
Despite or because of its ubiquity, BASIC has become a target of derision for many modern programmers. Inextricably associated with Microsoft and that bane of structured programmers, GOTO, the language has been said to encourage tangled, unmanageable code, to be unbearably slow, and to be suitable only for children and amateurs. Yet many programmers in the early twenty-first century remember BASIC fondly. The language was a popular success, worked well for small programs that let home users explore the possibilities of computing, and fostered creativity and innovation in several generations of computer users and programmers.
A Brief History of Programming
While there is some dispute over who should rightly be called the first computer programmer, many have awarded this designation to Ada Byron, the Countess of Lovelace. Raised by her mother and educated extensively in mathematics and logic so that she might follow a different path from her father, Lord Byron, Ada Byron is an illustrative example of the struggle to keep computation apart from poetics. While aesthetics and processing may mingle in 10 PRINT, far too often in history they have been seen as opposites, the Dionysus and Apollo of the digital world.
Ada Lovelace's contributions as an early programmer are most evident 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 to execute Lovelace's program was never built, her project made an important contribution to the modern idea of the computer program (Fuegi & Francis). This contribution was the concept that a program consisted of an algorithm delineated in mathematical notation.
The computer programs that followed in the electromechanical and early electronic age of computing were less intelligible than Lovelace's algorithm, bearing little relationship to any kind of written word -- or numbers. For example, the ENIAC, a fully electronic computer built at the University of Pennsylvania from 1943 to 1945, was programmed initially by plugging in an elaborate set of cables (da Cruz). To run particular calculations, constants were then set using dials.
The next step in programming was machine language. A program in machine language was simply a sequence of numbers that spoke, as it were, to the machine in the machine's own language. Each number corresponded to a particular machine operation, while the operands, if there were any, were similarly provided as numbers. On the ENIAC, these numbers were decimal (base 10), but different bases were used on other early systems. The EDVAC used binary; the ORDVAC, octal; and the BRLESC, sexadecimal (Bergin 62). In all of these cases, programmers arduously determined the sequence of numbers that would constitute a program, resulting in code that did not remotely resemble any spoken human language. For instance, to jump unconditionally to a particular absolute address, an opcode such as "76" (in base 10) is used, followed by two bytes specifying the address. In fact, this is the opcode used for an unconditional branch to an absolute address on the Commodore 64 -- though one would never know from looking at it.
A more legible form of code arose in the second generation of programming languages, called assembly languages. Assembly allows mnemonics for operators such as LDA ("load accumulator"), JMP ("jump"), and INC ("increment memory") to stand in for the more esoteric numerical codes. On the Commodore 64, the letters JMP followed by an absolute address are converted by the assembler to "76," in effect translating the human-legible mnemonic into machine language. The first assembler ran on Cambridge University's EDSAC in 1949. EDSAC was, incidentally, the first computer capable of storing programs, a feature modern computer users have taken for granted for decades (Campbell-Kelly and Aspray 184).
Although cryptic compared to a high-level language such as BASIC, an assembler program is nevertheless more comprehensible to a human 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 modeling financial 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 outlined in 1954 and first implemented in 1957. This language, and particularly the next version of it (FORTRAN II, which appeared in 1958), had a very strong influence on BASIC. Just as FORTRAN was designed with mathematics in mind, COBOL (Common Business-Oriented Language) was introduced in 1960 to address business uses. FORTRAN and COBOL both allowed for more intelligible code, improving on assembly. But both were also developed in the context of batch processing, for use with stacks of punched cards that would be processed by the machine one at a time. Punch cards were first used in the 18th century to define patterns in mechanical textile looms, but the concept was adopted in computing in the 20th century. The paragon of the punched card became known as simply "the IBM card," IBM's 80-column punched card, introduced in 1928. 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 definite 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 take the form of a stack, often a massive stack, of punched cards. These had to be punched on a keypunch machine and fed into a card reader by an operator. Line numbers were essential should a greatly feared random act occur: if someone dropped the stack of cards and they needed to be resorted into order.
FORTRAN's GOTO command was the basis for the GOTO in the original BASIC (MoP 86), which of course was carried over into Commodore 64 BASIC. GOTO functions in the same way the assembly language JMP does, shifting the interpreter to a specific location of the program. If one were simply interested in easily writing JMP statements, BASIC offers little advantage. Where BASIC shone, though, were in commands such as PRINT. What would take many steps in machine language is efficiently accomplished by a single command in BASIC. The drawback, which becomes more apparent with larger programs, is that every act of translation from a BASIC command to the multiple machine language steps evoked by that command results in a greater time drag.
Still, the time delay inherent in the act of translation from human language to machine language amounted to very little compared to the time saved by using a language specifically designed 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 Dartmouth. Late that year, in an article that declared the isolated college was coming "out of the woods," Time noted 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." Also in 1962, Kemeny and his colleague Thomas Kurtz had begun developing a time-sharing computer system and a new programming language to be used by all students at Dartmouth -- not just those studying math, science, or engineering. Kemeny and Kurtz aimed for nothing less than a computing revolution, radically increasing access to computers and to computer programming. "While the availability of FORTRAN extended computer usage 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" (Kemeny 30).
To reach millions, Kemeny and Kurtz would clearly have to lower the existing barriers to programming, barriers which were related not only to the esoterics of programming languages but also to the physical limits and material nature of computing at the time. The two began working with a team of undergraduates to develop the Dartmouth Timesharing System, and with it the BASIC programming language. They considered developing a subset of FORTRAN or Algol, but found these options unsuitable (Masterminds of Programming 79). As 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 81). 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. Oddly enough, BASIC was so relaxed that spaces between tokens were optional in Dartmouth's versions of the language. Spaces were ignored, as Kurtz explains, because "some people, especially faculty members, couldn't type very well" (MoP 81). This aspect of Dartmouth BASIC was carried over onto the Commodore 64, which, as mentioned in the introduction, allowed for even more compact versions of programs, including 10 PRINT.
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). Kemeny and Kurtz envisioned BASIC as a true high-level language, allowing programmers to operate without any detailed knowledge of the specific hardware they were using. The initial idea, at least, was that programmers need only pay attention to BASIC instead of the computer that BASIC happened to be running on.
DTSS and the versions of BASIC that ran on it served almost all of the students at Dartmouth; by 1971, 90 percent of the seven most recent classes of freshmen had received computer training. Dartmouth extended access to its system to other campuses, and it also inspired the creation of other time-sharing systems 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 292). Well before the microcomputer revolution of the late seventies, 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 was pervasive. The permissive attitude of Kemeny and Kurtz led to many different implementations of BASIC for different systems. Writing in 1975, one observer noted that "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 6). However, the very permissiveness that led to BASIC's widespread adoption and adaptation ironically meant that the language wasn't as independent of particular hardware as Kemeny and Kurtz had planned.
In addition to BASIC and the DTSS, there is yet another legacy from Dartmouth that has powerfully swayed the direction of modern computing. It is simply this: the almost evangelical mission to foster a more productive and creative relationship to computing. In his 1972 book Man and the Computer, Kemeny defends programming and playing games and other "recreational" uses of the computer as important, writing that such activities are relaxing and help people to overcome their fear of computers (35). Kemeny also describes 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 permission 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" (Kemeny 33). Computers were for everyone. BASIC was the embodiment of this openness, which allowed for programs with no obvious military, business, or scientific purpose -- programs such as 10 PRINT -- to come about.
It's not surprising that Kemeny's liberal ideas about computers and education were mirrored by his achievements as the President of Dartmouth College, a position he served from 1970 to 1981. Kemeny presided over Dartmouth's conversion to a coeducational campus, removed the "Indian" as the college's mascot, and encouraged the recruitment of minority students. On his final day as president, he gave a commencement address that warned students, including those involved in the recently-founded conservative Dartmouth Review, against the impulse that "tries to divide us by setting whites against blacks, by setting Christians against Jews, by setting men against women. And if it succeeds in dividing us from our fellow beings, it will impose its evil will upon a fragmented society" (Faison). After leaving the presidency of Dartmouth, he returned to full-time teaching, passing away in 1992. Thomas Kurtz continued to teach at Dartmouth long after he worked on BASIC, directing the Computer and Information Systems program there from 1980 to 1988.
CHR$ and the Dollar Sign in BASIC (Sidebar)
In designing BASIC, Kemeny and Kurtz wanted to distinguish between variables that held numeric values and variables that held strings of text. They chose to have string variables and string functions end with a "$," so that a string variable might be named A$ and the function that produced one-character strings based on ASCII values was called CHR$. They selected the dollar sign because there "were not so many keys on a Teletype, and we needed to find one that had not yet been used for BASIC. Of the few remaining ones, none seemed very appropriate. Then one of us observed that $ looks like S for string" (Kemeny & Kurtz 28).
Computers are fundamentally machines that add and multiply, so it is a curious circumstance that the Commodore 64 keyboard, like modern North American keyboards, has a dollar sign on it but does not have a multiplication sign. Instead, the asterisk (*), the typographical mark once used to indicate a footnote, is pressed into service as the symbol for multiplication.
Why would a keyboard have a dollar sign but not a multiplication sign? Even though interactive processing (as opposed to batch processing with punched cards) was a novelty, teletypewriters had been used as interfaces to computers long before the 1960s. Various sorts of TTYs, teleprinters, or "printing telegraphs" were used commercially as a means of textual communication beginning in the 1910s. Based on pre-ASCII characters codes that came from telegraphy, these systems were used to transmit dollar amounts much more frequently than they were used for sending mathematical equations. Murray Code, the 1901 revision of the standard 1870 telegraph code, included two characters that allowed "shifting" into alternate sets. A shifted "D" would become a "$" in Murray Code.
Interestingly, the original, North American Commodore 64 keyboard sported a pound sterling sign (£), a figure absent from other U.S. computers of the time. The presence of this key is a clear indicator of Commodore's plans to sell its computers in the United Kingdom, although the key had a precedent in Murray Code, which also features a pound sterling sign.
The dollar sign is still used in some of today's workhorse programming languages, such as Perl and PHP. In both of these, it is used to indicate a variable by being placed at the beginning, rather than the end, of the variable name. In Perl it specifically indicates a scalar variable, since $ looks like S for scalar.
Altair BASIC and Micro-Soft
The computer had already become more welcoming and accessible thanks to innovations on university and college campuses, but it wasn't until the computer moved into the home that the true revolution began. In popular lore, that revolution began with a single photograph of a panel of switches and LEDs on the cover of the January 1975 issue of Popular Electronics -- the first public look at the Altair 8800 minicomputer. While the history of BASIC at Dartmouth shows that personal computing did not suddenly spring to life fully developed in 1974, that year does mark an inflection point for home computing.
Proclaiming in a headline that "THE HOME COMPUTER IS HERE," Popular Electronics gushes about the possibilities of the $395 Altair 8800 ($495 assembled). The magazine 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" (38). As it happened, even the applications that were within the capabilities of the device were rather difficult to realize since the system by default could only be programmed in machine language. Furthermore, unless one happened to have a Teletype or other terminal lying around, the programming had to be done mechanically, with the toggle switches on the front panel. The home computer may have arrived, but most users would have no way of talking to it. From the outset, it was clear that the Altair 8800 needed a programming language that facilitated experimentation. Popular Electronics mentions four programming languages by way of explaining the distinction between hardware and software (34); one of these languages was BASIC, the language that showed the most promise to early Altair 8800 enthusiasts.
There were two successful efforts to develop a BASIC interpreter for the Altair, and their varied histories have had a lasting impact upon modern computing -- and indeed, upon modern culture. While this tale of two BASICs is not about the best of BASIC and the worst of BASIC, it does highlight 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 MITS, the Altair's manufacturer; 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; its BASIC 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 in December 1974, just after the issue hit the stands. Allen read the Altair 8800 article and raced to show it to his friend and business partner Bill Gates, telling him, "Well here's our opportunity to do something with BASIC" (Wallace & Erikson 67). The two had already had some limited success when Gates was still in high school, with a venture called Traf-O-Data that produced hardware and software to count cars. They programmed the Intel 8008 microprocessor that powered Traf-O-Data using a simulator running on a Washington State University mainframe.
By 1975, Gates was at Harvard University and he and Allen were ready for a project with broader reach. They devised the idea of writing BASIC for the Altair and called Ed Roberts at MITS to ask if he would be interested in having their BASIC for his system. Roberts said he would buy the first version that worked (Wallace & Erikson 74). As Gates and Allen had done when developing 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 is attributed to entrepreneurial and business advances and to Microsoft in particular, it's remarkable that Microsoft's first product was developed borrowing time from Harvard's computer and was (as Microsoft clearly acknowledged) an implementation of Dartmouth's freely-available programming language.
Gates and Allen devised the Altair BASIC project and did most of the programming, but there was a third Altair BASIC programmer, a sort of legendary fifth Beatle of Microsoft (or at least of Altair BASIC). This was Monte Davidoff, who wrote the floating-point routines. Gates and Allen were discussing how they needed to code these up when Davidoff, a student who was sitting with them at the table, spoke up and said he could write them. After talking it over with him, they enlisted him to contribute these (Wallace & Erikson 76-77).
The code of this first Microsoft project is mainly by Gates and Allen, though, with Gates listed as first author. Comments at the beginning of the code declare, "BILL GATES WROTE THE RUNTIME STUFF," which he did over a period of eight weeks at Harvard. Gates would say years later that this 4 KB BASIC interpreter "was the coolest program I ever wrote" (Wallace & Erikson 76-77).
Allen flew to visit MITS in Albuquerque, taking the program on paper tape. He realized during the plane's decent that he did not have a way to get the Altair to read the tape and run it -- a bootloader. So he wrote one in machine language as the plane was landing. Then, he headed to see an Altair for the first time -- all of the work he, Gates, and Davidoff had done was via a simulator. The BASIC demo, of course, was a success and the interpreter 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, and Microsoft was booted and running.
From a technical and business standpoint, Altair BASIC was not an early oddity, but a Microsoft product with a strong relationship to the company's later flagship products. To see the connection, it's important to understand the nature of computing platforms and their relationship to markets of different sorts.
The book Invisible Engines introduces 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 another example of a platform with at least two sides. 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 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.
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 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 waslaunched 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 further participated in the culture of sharing and openness by publishing Richard Stallman's "GNU Manifesto," the first critical document of the free software movement.
The development of Tiny BASICs continued after this first version. The fourth Tiny BASIC, written by Li-Chen Wang, was called Palo Alto Tiny BASIC. It, too, was published initially in Dr. Dobb's. The source listing for this BASIC interpreter began:
;************************************************************** ;* ;* TINY BASIC FOR INTEL 8080 ;* VERSION 1.0 ;* BY LI-CHEN WANG ;* 10 JUNE, 1976 ;* @COPYLEFT ;* ALL WRONGS RESERVED ;* ;**************************************************************
This anti-copyright notice, while it does not feature the same use of "copyleft" as free software licenses did beginning in the late 1980s, was a jab at the closed culture of copyrighted, proprietary code. Because Wang chose to declaim copyright and reserve only the "wrongs" of the program, Palo Alto Tiny BASIC was able to serve as the basis for a commercial BASIC: Level I BASIC for the TRS-80, the influential microcomputer that was sold beginning in late 1978.
The Ethic vs. The Corporation
In his 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 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. Many see it as the beginning of Microsoft's career of unfair dealing and of embracing and extending, a practice where the company takes existing tools and ideas and creates their own version for competitive advantage. Judge Thomas Penfield Jackson wrote in 2001, during the antitrust case against the company, that "Microsoft is a company with an institutional disdain for both the truth and for rules of law that lesser entities must respect." He was hardly the only one with this view at that point. Did Microsoft's turn to the dark side begin with this letter to hobbyists?
There are a few complications to the most popular version of this early clash, and too simplistic assignment of good and evil roles, just as there are complications in considering Altair BASIC as completely bad and TinyBASIC as pure and just.
For one thing, neither Microsoft, nor Gates, nor Allen was 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). At the beginning of 1976, "Micro-Soft" (the spelling had not been regularized by the time of the first letter) was simply two partners, both recent college drop-outs, one a teenager and other only slightly older. The company had paid other people, such as BASIC contributor Davidoff, but 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 it is 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 was likely to become the norm. He even suggested that good "compilers and interpreters" (such as Microsoft's Altair BASIC) would 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 certainly had a concept of software that would allow for it to be sold and tightly controlled by a corporation, but he was 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 also did end up facilitating new software creation with BASIC and also 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 minicomputer time-sharing environment and onto microcomputers but also beyond the hard core of code-sharing enthusiast programmers.
Another sign that Microsoft was not completely at odds with the PCC is found in Appendix M to the Altair BASIC manual. On this list of "a few of the many texts that may be helpful in learning BASIC," all but one of the books can be ordered from the PCC, whose address is listed. Five of the six books are about BASIC specifically, but the manual also lists the radical and countercultural Computer Lib / Dream Machines by Theodore H. Nelson. In 1987, an edition of this book would be published by Microsoft Press.
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, significantly, the hacker ethic of code sharing that allowed BASIC programs to circulate freely.
Line Numbers and Colons: BASIC's Responses to Changing Hardware (Sidebar)
Microsoft has used its position as a corporate supporter of BASIC to make many changes to the language beginning with the days of the Altair, adding and removing pieces that became necessary or obsolete as hardware progressed. For example, to allow programs to be written more compactly--an important feature given the Altair's interface, which could literally be painful to program--Microsoft's Altair BASIC introduced the colon (:) as a separator of statements on the same line. This allowed 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.
Another prominent feature that appears in 10 PRINT is also an artifact of the hardware lying beneath the language. Unlike its punch card-derived predecessors, BASIC didn't require programmers to put things in certain columns; but there was a requirement that a number, such as "10", appear at the beginning of each line. While this facilitated branching by allowing the GOTO and GOSUB statements refer to line numbers where program flow should jump to, BASIC did not actually need line numbers for this purpose. Labels, such as those used in pre-existing languages like assembly, would have sufficed. The line number's real value is seen on a Teletype or other print terminal, or in any environment where full-screen, nonlinear 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, just retype a line with the same line number. To see what code is currently on a particular line, "LIST 50" will do the trick -- although if one had written the line recently, one could also look up or literally "scroll" back to where the line had been printed out.
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 a 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).
While line numbers became an iconic feature of BASIC early in the personal computing era, they also contributed to a perception among programmers that the language is limited to simple tasks. Leaving space to add nine new lines of code between every original line may initially seem like plenty of flexibility, but it is rarely enough when programmers have a complex problem to solve. BASIC can still accommodate this situation by allowing the programmer to use GOTO and GOSUB to jump to unused numbers where they can write their new code outside of the existing numbering scheme, then return to the original program flow when it is complete. Unfortunately, the result of doing this is usually what is called spaghetti code--so named because the flow chart of a program becomes so confused and self-referential that all the lines look like a plate of spaghetti, making it nearly unintelligible.
In 1991 Microsoft realized that the perception of BASIC as limited to simple programs was holding the language back, and that this perception was largely due to a feature of the language that was no longer even necessary. Text editors that could display and allow access to screenfuls, or windowfuls, of lines had long been available, and line numbers were now doing more damage than good. As part of their 1991 QBasic the company deprecated line numbers, replacing them with the assembly-like text labels that had originally been dismissed as inconvenient on the hardware of the era.
The simple fact that 10 PRINT includes both the colon and the line number -- features that have been added and removed from BASIC in response to hardware changes -- signals that 10 PRINT is from a particular time and related to a specific era of computing caught between competing input mechanisms. Its heritage and provenance is literally written right into its code.
Commodore BASIC
Insert BASIC timeline or family tree
The Commodore 64 BASIC on which 10 PRINT runs is a Microsoft product and a descendant of Altair BASIC, although the first step for achieving this BASIC was creating a version for the Commodore 64's chip, the 6502. (The Altair used the Intel 8080, which had a different instruction set.) The task of developing a 6502 version of Microsoft BASIC was undertaken in 1976 and fell mainly to Richard Weiland. When a user types "A" in response to the startup question "MEMORY SIZE?", the version of Microsoft 6502 BASIC that was licensed to Ohio Scientific replies "WRITTEN BY RICHARD W. WEILAND," while version 1.1 for the KIM declares "WRITTEN BY WEILAND & GATES." But the first version of Microsoft's 6502 BASIC that made its way into the ROM of a shipping system, in 1977, was a version for Commodore -- not for the Commodore 64, but for the company's first computer, the Personal Electronic Transactor or PET.
The BASIC included with the Commodore PET was very similar to Commodore BASIC 2 for the Commodore CBM and the BASICs included on the VIC-20 and Commodore 64. (The version history of Commodore BASIC is a bit complicated, as the "COMMODORE 64 BASIC V2" that appears on the top of the screen indicates the second release of BASIC V2.0; this version was originally provided with a model of the PET 2001.) Other aspects of Commodore computers, such as the PETSCII character set, are similar across models as well. For these reasons, 10 PRINT will run without modification on a Commodore PET or a VIC-20. What mainly suggests that the program should be identified with the Commodore 64 is the presence of 10 PRINT variants in a Commodore 64 manual and a later magazine.
Versions of Microsoft's 6502 BASIC were used not only on the PET and Commodore 64 but also on competing computers: the Apple II series and Atari's 8-bit computers, the Atari 400 and Atari 800. Microsoft certainly benefited from selling the same product to many computer computer companies, but didn't manage to make the usual licensing deal with Commodore. As the founder of Commodore, Jack Tramiel, explained at a 25th anniversary event honoring the Commodore 64, Bill Gates "came to see me. He tried to sell me BASIC. And he told me that I don't have to give him any money. I only have to give him $3 per unit. And I told him that I'm already married." Tramiel told Gates he would pay no more than a $25,000 flat fee for BASIC -- an offer that Microsoft ultimately accepted. This was a very good deal for Commodore, since about 12.5 million Commodore 64s were ultimately sold (Steil).
The features of BASIC that are seen in 10 PRINT and are fairly specific to the Commodore 64 version are seen in the specifics of RND, discussed in the Randomness chapter, and in the character set that CHR$ refers to, discussed in the Commodore 64 chapter.
A few notes on the creators of Commodore 64 BASIC: Bill Gates's career trajectory is, of course, well-known. It is indeed the case that one of the programmers who wrote Commodore 64 BASIC became the richest person in the world. Paul Allen is not far behind in wealth; he left full-time work at Microsoft in 1982. Gates are Allen are notable philanthropists today. The other coder who contributed to the original Altair BASIC, Monte Davidoff, did not strike it nearly as rich but, according to an interview, was still active as a programmer in 2001. Davidoff was then running Linux and preferred to program in Python (Orlowski).
The programmer of Microsoft's 6502 BASIC, Richard Weiland, was a grade-school classmate of Gates and Allen who joined Microsoft when the company was based in Albuquerque. He worked for Microsoft until 1988 and devoted much of his time and money from then until his death in 2006 to philanthropy. He supported the Pride Foundation (with the largest-ever donation to LBGT rights), Stanford University (with the largest donation that university had ever received) and also gave to the Audubon Society and the Nature Conservancy (Heim).
Circulating Programs in Print
From the first years of the language, BASIC programs circulated as ink on paper. In 1964 and for many years afterward, 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. From the mid-1970s through the early 1980s, BASIC was known in print not only through manuals and textbooks that explicitly taught programming, but also through collections of programs that appeared in magazines and computer club newsletters. The printed materials that remain today reveal insights into the practices of BASIC users and the culture that developed among them.
Computer magazines often featured BASIC programs a home user could easily key in to his or her home computer. There was the previously mentioned Dr. Dobb's, but also many others. For instance, Creative Computing was a significant early magazine for microcomputer hobbyists. Launched in 1974 before the debut of the Altair 8800, Creative Computing was published until 1985, essentially spanning the era of BASIC's greatest popularity.
As Creative Computing was nearing the end of its run, other magazines, many of them platform-specific, were just getting started. One was RUN (1984-1992), a monthly magazine published by IDG Communications, focused on the Commodore 64 and VIC-20. RUN is particularly noteworthy, as one version of 10 PRINT in its pages. A German edition of RUN was published as well, and ReRUN disks made programs in the magazine available for purchase in machine-readable format. Another home computer magazine of this era was Compute! (1979-1994), which began as Pet Gazette, a 1978 magazine put together by Len Lindsay about the Commodore PET computer. In July 1983, Compute! launched a spin-off publication, Compute!'s Gazette, for Commodore 64 and VIC-20 owners. In the UK there were several other magazines for Commodore users, including Zzap! 64, Commodore User, and Commodore Format. The last of these did not start publishing until October 1990. This magazine was not about BASIC or learning to program, however. It focused on gaming and offered game news, reviews, and cheats, with its "Powerpack" tape offering full games and demos for subscribers to load and run.
While magazines were ready and regular sources of new programs, many also found enjoyable code in books. David H. Ahl's influential and early compilation, 101 Basic Computer Games, was first published in 1973 by the Digital Equipment Corporation (DEC). This was the first book to collect only games in BASIC. It includes a sample run of each game and acknowledges the programmers who contributed each game. Each program's "computer limitations" are described so that users understand the specific BASIC dialects and hardware that are supported. Illustrations, courtesy of Mad Magazine among others, punctuate the presentation -- a rather playful presentation for a corporate publication from a 1970s computer company. The game's titles are abbreviated, not exceeding six letters, so they can serve as filenames. The abbreviations were humorously cryptic, with ACEYDU standing for "Acey Deucy Card Game"; AMAZIN for "Draw a Maze"; or POET for "Random Poetry (Haiku)." In the preface, the educational value of playing and creating games and the need for "unguided learning" is emphasized, echoing Kemeny's own thoughts about the value of purposeless play on computers.
A new edition of this book, Basic Computer Games, Microcomputer Edition, appeared in January 1978 -- reflecting BASIC's move from timesharing minicomputers to microcomputers. This edition's preface begins with a dictionary definition (from an unnamed dictionary) of the word "game." 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, emphasizing that games offer recreational breaks from the "realities of life" and also have other "important redeeming virtues." The programs in this book are all said to run on the gold standard of microcomputer BASICs: MITS Altair 8K BASIC, Rev. 4.0 (ix). The games, no longer referred to by cryptic six-character tags, are organized by category -- e.g., Educational, Number and Letter Guessing, Sports Simulation, Gambling Casino, Card and Board, and so on. While none of these categories would accommodate the purely aesthetic nature of 10 PRINT, it's interesting that so many of them rely upon a key feature of 10 PRINT: randomness.
Later in 1978, this compilation was published again by Workman Publishing under the lengthy title 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. Its translation into German in 1982 (and reprinting in German in 1983) shows how BASIC games, no doubt thanks to this book's large trade publisher, made their way abroad.
The People's Computer Company offered a collection of BASIC games, too: Bob Albrecht's large-format What To Do After You Hit Return, which came out originally in 1975. This book was handed off to a series publishers and underwent several printings. Neither the front nor the back cover even bothered to mention that the programs inside were in BASIC, indicating that the language was the lingua franca for recreational programming.
Given the growing popularity of BASIC and computers among hobbyists, it is not surprising to see other, presentations of BASIC such as the 1978 The Little Book of BASIC Style. How to write a program you can read by John M. Nevison. With its reference to the Elements of Style by E. B. White, this book insists that programs have human readers and can be written with them in mind. Related titles include the 1979 Programming for Poets. A Gentle Introduction Using BASIC, a simplified textbook, and the 1978 BASIC With Style. Programming Proverbs.
While many early books about BASIC are about pursuing hobbies and playing games, and others were focused on teaching the reader programming, there were also ones such as Charles D. Sternberg's BASIC Computer Programs for the Home (1980). Its specific aim was to satisfy "the practical requirements of the home." The author encourages the "modification of these programs to utilize features of your particular machine should present few difficulties." 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.
There were plenty of features of printed BASIC programs that facilitated exploration, modification, and learning. While programs in machine language were also printed at times, printed BASIC programs such as 10 PRINT were distributed as human-understandable source code. Since people typed them in, they were easily able to type further and modify the programs -- or even to make some changes as they were entering them. And, since programs sometimes had typos in them or didn't work with a particular reader's dialect of BASIC, modifying the program was sometimes necessary. The transmission of BASIC programs in print wasn't a flawless, smooth system, but it did encourage engagement with code, an awareness of how it functioned, and a realization that it could be revised and reworked.
BASIC Code in Human Memory
Many have difficulty now remembering 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. Programs were indeed transmitted in this way, though; a hint of this is still seen when people are invited to key in code snippets from books on programming.
There is an even stranger way that programs, particularly short ones such as BASIC one-liners sometimes made their way from computer to computer and from person to person: by being memorized. This is not to say 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 remember a one-liner, or a handful of short programs, so that they could be typed into a friend's computer. Very short programs that did visually interesting things were particularly worth memorizing; in the late 1970s and early 1980s, the mass of these were of course in BASIC. (See "Remarks: One-Liners" for several examples.) 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 a program that contained two statements in that language, 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, who initially appears as a fat slob who, after the death of his only friend Liam, spirals 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 not only documentation but a mass of code.
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 furthermore 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.
For many programmers, however, memorizing one-liners (not the entire codebase) is both possible and useful. Perl is used for a wide variety of text processing tasks; many who program in it find it useful to write, recall, or adapt one-line programs that work on the command line. For instance, to convert a file dosfile.txt with DOS-style line endings to Unix format, a common task for many programmers, the carriage returns (\r) must be removed. This can be accomplished with the command perl -p -i -e 's/\r\n/\n/g' dosfile.txt which includes a very short program (between quotes) to perform the needed substitution. With a few changes, this code can be adapted to replace one word with another, for instance, substituting "Commodore" for every occurrence of "Atari": perl -p -i -e 's/Atari/Commodore/g' manuscript.txt.
Programmers who use such Perl one-liners do not seem to remember them the way one memorizes lines from a play or a song. They would generally understand how the substitution operator (s///) functions and how command-line flags to Perl work. In other words it is knowing Perl, not just the memorization of a string of symbols, that is important to most uses of Perl one-liners. But the phrase "Perl pie" does helps some to quickly recall which command-line flags are needed in this case, and one-liners are at times as much recalled as figured out and programmed. Many common one-liners are not programmed "from scratch" each time they are used.
This type of non-rote memorization is the sort that BASIC programmers also employed in bringing 10 PRINT from one computer to another to show off its output. Remembering code, like having it printed with the occasional typo, was a "lossy" way to transmit programs. This didn't have purely negative effects, though. Instead of the prefect but opaque way of transferring files via disk or download, the recall and reading of programs left a space for the programmer to work and play. If the recalled version of the program didn't work correctly, the programmer could think about how to change it. If it did work well, the programmer might think to change it further to see what could be done. The wiring of these printed and memorized programs was sometimes messed up, but they were also not in a closed black box.
Studies of Program Memorization (Sidebar)
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, referring to the cognitive science literature on remembering sentences, reported a statistically significant difference between subjects of different ability levels attempting to memorize a FORTRAN program and a series of valid statements in scrambled order, "leading us to the conclusion that the structure of a program facilitates comprehension and memorization" (127).
Ruven Brooks published a more elaborate theory of program comprehension in 1983; 10 PRINT shows some ways in which this theory is not generally applicable. 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" (543). Brooks posited the useful idea that certain lines were "beacons," specially indicating program structures and operations (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," including "Indentation or pretty-printing" and "Flowcharts" (551). None are present in the case of 10 PRINT. 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." (545). In fact, the problem is not just with abstract processes and mathematical routines. Brooks's model cannot directly apply to any creative program that lacks a real-world domain. What are the "cargoes and routes" 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." (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." (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 ..." (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. Memorization was used as a measure of comprehension, the real feature of interest; 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.
10 PRINT represents a category of programs that were historically memorized but which existing theories of program memorization, created for longer 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 has certain things in common with the tasks 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.
A Personal Memory of 10 PRINT (Sidebar)
by Nick Montfort
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 then also 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 print characters 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.
Works Cited
Bergin, Thomas J., ed. Fifty years of Army computing. U.S. Army Research Laboratory. 2000.
Brooks, Ruven. "Towards a theory of the comprehension of computer programs." International Journal of Man-Machine Studies 18. pp. 543-554. 1983.
Campbell-Kelly, Martin and William Aspray. "Computer: A History Of The Information Machine." Basic Books. 1996.
Commodore Business Machines. Commodore 64 User’s Guide. Commodore Business Machines. Distributed by Howard W. Sams & Co. 1982.
da Cruz, Frank. "Programming the ENIAC." In Columbia University Computing History. 25 January 2011. http://www.columbia.edu/acis/history/eniac.html
Doctorow, Cory. "0wnz0red." Salon.com. August 28, 2002.
Driscoll, Kevin. "Revisiting Bill Gates' 'Open Letter to Hobbyists.'" Presentation at Media in Transition 7, MIT, Cambridge, MA. 14 May 2011.
Evans, Davis S., Andrei Hagiu and Richard Schmalensee. Invisible Engines: How Software Platforms Drive Innovation and Transform Industries. MIT Press. 2006.
Faison, Seth. "John Kemeny, 66, Computer Pioneer and Educator." The New York Times. 27 December 1992. http://www.nytimes.com/1992/12/27/us/john-kemeny-66-computer-pioneer-and-educator.html
Fuegi, John and Jo Francis. "Lovelace & Babbage and the Creation of the 1843 'Notes.'" IEEE Annals of the History of Computing, October-December 2003. pp. 16-26.
Heim, Kristi. "Seattle man who helped launch Microsoft left $65M for gay rights." Seattle Times. 24 February 2008. http://seattletimes.nwsource.com/html/localnews/2004197961_weiland24.html
Kemeny, John G. Man and the Computer. Simon Schuster. 1972.
Kemeny, John G., and Thomas E. Kurtz. Back to BASIC: The History, Corruption, and Future of the Language. Addison-Wesley. 1985.
Kurtz, Thomas E. "BASIC" [Interview], chapter 5 of Masterminds of Programming: Conversations with the Creators of Major Programming Languages, Eds. Federico Biancuzzi and Shane Warden, O'Reilly Media, 2009.
Levy, Steven. Hackers: Heroes of the Computer Revolution. New York: Dell. 1984.
Mullish, Henry. A Basic Approach to BASIC. John Wiley & Sons. 1976.
Orlowshi, Andrew. "Microsoft Altair BASIC legend talks about Linux, CPRM and that very frightening photo: A very rare interview with Monte Davidoff" The Register. 11 May 2001. http://www.theregister.co.uk/2001/05/11/microsoft_altair_basic_legend_talks/
"Out of the Woods." Time 80:21. 23 November 1962. http://www.time.com/time/magazine/article/0,9171,829487-1,00.html
Shneiderman, Ben. "Exploratory Experiments in Programmer Behavior." International Journal of Computer and Information Sciences 5:2, 1976, pp. 123-143.
Steil, Michael. "How many Commodore 64 computers were really sold?" pagetable.com. 1 February 2011. http://www.pagetable.com/?p=547
Swaine, Michael. "Dr. Dobb's Journal @ 30. Dr. Dobb's: The World of Software Development. 1 January 2006. http://drdobbs.com/architecture-and-design/184406378
Widenbeck, Susan. "Beacons in computer program comprehension." International Journal of Man-Machine Studies 25. pp. 697-709. 1986.
