BASIC

From Maze

Revision as of 13:06, 26 June 2011 by PatsyBaudoin (Talk | contribs) (→Circulating Programs in Print)
Jump to: navigation, search

Contents

[hide]
  • 1 A Brief History of Programming
  • 2 Dartmouth BASIC and Time-Sharing Minicomputers
  • 3 Altair BASIC and Tiny BASIC, Micro-Soft and Copyleft
  • 4 Circulating Programs in Print
  • 5 Programs in Human Memory
  • 6 Works Cited
  • 10 PRINT is a computer program that operates in a particular way; it is also 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 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 signals one important aspect of its use. 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, and 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 became available, provided in a kit which the purchaser had to assemble. This computer was widely acclaimed as the first home computer. 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 startup company, known at the time as "Micro-Soft." The company didn't stop at this version. 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, 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 so obvious that this language was the dominant one that some books of BASIC programs do not even find it necessary to mention "BASIC" on their cover or in introducing the book.

    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, for instance, made line numbers optional. And 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, as they should. The language was a popular success, worked well for small programs that tested 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. 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" which Lovelace programmed was never built, and there is evidence that the algorithm in question was originally written by Babbage, Lovelace's project was instrumental in developing the modern idea of the computer program.

    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 mathematical notation. The ENIAC, a fully electronic comptuer which was built at the University of Pennsylvania from 1943 to 1945, was programmed 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 was 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.

    The step was seen in so-called "second generation programming langauges," which are assembly languages, still used in rare cases today. 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. EDSAC sported the first assembler 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, which is just a sequence of numbers. While assembly is still used today in embedded systems, low-level programming, and 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 the program to business processes.

    To reach a level of programming more appropriate for these tasks, particularly the mathematical and scientific ones, FORTRAN (Formula Translation) was specified in 1954 and first implemented in 1957. To address the business side, COBOL was specified in 1959 and implemented in 1960. Both of these languages allowed even more intelligible code. But both were also developed for the context of batch processing, for use with stacks of punched cards -- particularly, for IBM's 1928 punched cards that had 80 columns, the same number of columns that standard printers and terminals had. (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 one wrote a one-liner, a COBOL or FORTRAN program would manifest itself as a stack, often a massive one, of punched cards, which had to be punched on a keypunch machine and fed into a card reader by an operator. Line numbers were of great importance if someone dropped the stack of cards, since they would have to be sorted into order.

    The creators of BASIC aimed to develop a programming language for the next computing revolution, one that would allow numerous users interactive access to a system simultaneously: 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] The 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 first Remark.

    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 (9).

    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. Although often associated with BASIC, GOTO did not originate with Kemeny and Kurtz's language. FORTRAN already had a GOTO statement, which was the basis for the one in BASIC (MoP p. 86). Before that, the unconditional branch was a feature of assembly and machine languages and did the same thing as GOTO.

    While numbered lines were to some extent helpful for branching, BASIC did not actually need line numbers for this purpose. 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.

    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)

    Even before computers moved into the home, they had become more welcoming and available for a wider variety of uses thanks in part to BASIC.

    Altair BASIC and Tiny BASIC, Micro-Soft and Copyleft

    While time-sharing was a significant and often overlooked revolution in computing, allowing programmers interactive access to the machine and eliminating the highly regulated ritual of submission of punched card stacks, it was only the first revolution in which BASIC played a critical role. The next revolution 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." Nevertheless, the article about this device 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!"

    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, and 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 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, if not developed at, 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 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, it's remarkable that Microsoft's first product was developed using Harvard's computer and by implementing Dartmouth's programming language.

    [Early history of MS Altair BASIC]

    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, where, for instance, both buyers and sellers must come together for profits to be made. Microsoft's Windows operating system is one example of a two-sided platform. On one side, computers need an operating system to function, so hardware manufacturers such as Dell purchase licenses to Windows and pass along the costs to consumers. 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 encourages users to stay with Windows.

    Of course, Windows was not the first two-sided platform -- it was not 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. It was the closest thing to an operating system that the Altair 8800 had, providing a layer of abstraction above machine language. Computers in the late 1970s and early 1980s needed BASIC on them seem full-featured and to provide an easier programming interface, so different computer manufacturers were eager to license the language from Microsoft. At Gates's 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.

    [Specification of and development of Tiny BASIC]

    Circulating Programs in Print

    BASIC programs, from the beginning, circulated as ink on paper. There was no Web or even Internet to facilitate the digital exchange of programs. It is interesting to consider the specific forms of printed matter that were used to communicate BASIC programs. In looking at the specifics of how BASIC was disseminated and traveled between and among different user communities, interesting signs are seen of the practices BASIC users developed, the habits they fell into, the culture that developed among them, and finally the trends they set and that now inflect the history of computing in more and less significant ways.

    Kemeny and Kurtz deployed BASIC on a time-sharing system in 1964, when time-sharing computers were themselves still quite new. Time-sharing computers transformed computing in several important ways. Time-sharing provided a much more efficient use of computer time by distributing the cycles of the machine among interactive users; it also distributed one computer to many users at once. The time-sharing model offered those who could not own a computer access to computing time that they could more easily afford. That BASIC should be designed for time-sharing computing is worth noting. It reflects the opportunity time-sharing computers opened for designing interactive development of new applications. The impulse of BASIC – Beginner's All-purpose Symbolic Instruction Code – was, after all, in part to provide easier access to the wonders of programming. The upshot, an easy-to-learn language on a system that made access more broadly available, marks a turning point in the history of computing. That this simplified and accessible model should claim space on college campuses first and then in schools thereafter is therefore hardly surprising. [I don't understand the implications of this paragraph, and in any case, this sort of discussion belongs in the part of the article dealing with time-sharing, not the part dealing with print transmission of programs. -nm]

    [find out more about BASIC’s transmission in print before the mid-1970s]

    From the mid-1970s through the early 1980s, the transmission of BASIC in print took several paths:

    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.

    Dr. DOBBS

    Sinclair User (UK) – from April 1982 thru April 1993

    [More to come on magazines-- please feel free to add to these magazine entries. Question: does anyone know of any foreign magazines worth mentioning here besides Sinclair User? Or any foreign editions of any of these besides Run? I don't think we need to enumerate every magazine. In each case, we should ask what is special or interesting about the publication. Which ones had BASIC programs? Does the presence of a C64 magazine and a TRS-80 magazine mean that these are stratified by platform? (Hint: YES) Does that indicate that not just BASIC, but the flavor/dialect of BASIC is important? -nm]

    BOOKS

    Almost every book transmitting information of BASIC in the 1970s could be called 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 decsribed so users understand the hardward requirements. Finally, 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 nametags 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 to the dissemination of BASIC.

    1. 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 many printings. Hayden began printing it in 1977; its 5th printing in 1979 was still printed inexpensively on newsprint paper.

    2. Given the growing popularity of BASIC and computers among hobbyists, it is not surprising to see other, even simpler presentations, of BASIC in other books. The Little Book of BASIC Style. How to write a program you can read. was written by John M. Nevison (and self-published by John M Nvison Associates) and seeks to echo the simplicity of the Elements of Style by E. B. White, whom the author invokes in his Preface.


    MANUALS

    This manuals accompanying the microcomputers that came with BASIC (e.g. the APPLE II, the TR684, and the Commodore 64) included samples of BASIC code that users could key in and run. This often got most users started and whetted their appetite for other programs that would have to be found in other places. Some users also reported frequently turning to tape cartridges to supplement the materials that arrived pre-packaged with their computers.

    [More to come on Manuals, which I have still to consult for the first time]

    Programs 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. While it may not have been a Fahrenheit 451 situation in which the world's great computer programs were preserved by a dedicated few, 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.

    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. This is one in which 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 program that is the focus of this book. 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 demos and intros from 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 memorization of BASIC one-liners is more long-term, is done for fun, and of course involves shorter 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 other 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.

    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.

    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.

    Personal tools