BASIC
From Maze
(Difference between revisions)
(Protected "BASIC": I am editing this entire chapter for a a few minutes ([edit=sysop] (indefinite) [move=sysop] (indefinite))) | (Edits throughout, moved memorization studies to a sidebar) | ||
| Line 178: | Line 178: | ||
== Circulating Programs in Print == | == Circulating Programs in Print == | ||
| − | BASIC programs, from the inception of the language, circulated as ink on paper. In 1964 and the years following, there was no Web or even Internet to allow for the digital exchange of programs, and it was often impractical to distribute programs on computer-readable media such as paper tape. From the mid-1970s through the early 1980s, BASIC was known in print not only through manuals and books that explicitly taught programming in the language, but also through collections of programs that appeared in magazines and in books. The printed materials that remain today give insight into the practices BASIC users developed, the habits they fell into, the culture that developed among them, and the trends they set that continue to inflect the history of computing. | + | BASIC programs were, from the first years of the language, circulated using ink on paper. In 1964 and the years following, there was no Web or even Internet to allow for the digital exchange of programs, and it was often impractical to distribute programs on computer-readable media such as paper tape. From the mid-1970s through the early 1980s, BASIC was known in print not only through manuals and textbooks that explicitly taught programming in the language, but also through collections of programs and program that appeared in magazines. The printed materials that remain today give insight into the practices BASIC users adopted and the culture that developed among them. |
| − | There were many computer magazines featuring BASIC programs in addition to the already-mentioned ''Dr. Dobb's.'' Others included ''Byte'', ''Creative Computing'', ''Compute!'', ''RUN'', and ''Rainbow.'' ''Creative Computing'' was a significant early magazine for microcomputer users interested in exploring computing. Founded by David H. Ahl, who also wrote some ground-breaking books, this magazine for the home computer hobbyist was launched in 1974 and published until 1985. | + | Many computer magazines featured BASIC programs in addition to the one discussed earlier in this chapter, ''Dr. Dobb's.'' For instance, ''Creative Computing'' was a significant early magazine for microcomputer users interested in exploring computing. Founded by David H. Ahl, who also wrote some ground-breaking books, this magazine for the home computer hobbyist was launched in 1974 (before the Altair 8800) and published until 1985. |
| − | As ''Creative Computing'' was nearing the end of its run, other magazines were just getting started. One was ''RUN,'' (1984-1992) a monthly magazine published by IDG Communications that printed a version of 10 PRINT in its pages. Like many microcomputer magazines, ''RUN'' was platform specific: It focused on the Commodore 64 and VIC-20. 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 that was specific to the Commodore PET computer. In July 1983, that magazine launched a spin-off publication, ''COMPUTE!'s Gazette,'' made for Commodore 64 and VIC-20 owners specifically. In the UK there were several other magazines for Commodore users, including ''Zzap! 64'', ''Commodore User'', and ''Commodore Format''. The last of these, which focused on the Commodore 64, 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 including full games and demos for subscribers to run. | + | 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 that was published by IDG Communications, focused on the Commodore 64 and VIC-20, and included a 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 that was specific to the Commodore PET computer. In July 1983, ''Compute!'' launched a spin-off publication, ''Compute!'s Gazette,'' for Commodore 64 and VIC-20 owners specifically. 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). 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 who wrote each game (there were many contributors) and names earlier sources, if any, for games. The program's "computer limitations" are described so users understand the hardware requirements. Illustrations, courtesy of ''Mad Magazine'' among others, punctuate the presentation -- a rather playful presentations for a corporate publication from a 1970s computer company. The game's titles are abbreviated into names that look rather cryptic today but could be generally used as filenames, since they did not exceed six letters. For instance, there was ACEYDU for "Acey Ddeucy CArd Game"; AMAZIN for "Draw a Maze"; or POET for "Random Poetry (Haiku)." The preface makes a point of teasing out the educational value of playing and creating games and the need for "unguided learning." DEC continued to publish a version of this book after Ahl left in 1974 -- just without Ahl's name on it. | + | 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 at at most six letters, so they can be used as filenames, since they did not exceed six letters. The abbreviations were rather cryptic, with ACEYDU standing for "Acey Ddeucy 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. |
| − | That wasn't the end of the book's publishing history, though. The first printing of ''Basic Computer Games, Microcomputer Edition'' in January 1978 signaled the fact that, at the time of the first publication of ''101 Computer Games'', microcomputers had not yet been introduced. The preface of this "Microcomputer Edition" differs significantly from the preface in the DEC editions. It 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, 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 what must have been considered the gold standard of microcomputer BASICs: 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) | + | 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., "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. Perhaps these categorizations relate to later, well-recognized computer game genres. But it would be hard to fit 10 PRINT into any category except "Introductory Fun" or (to use the category found in ''RUN'') "One-Liner." |
| − | This first non-DEC printing drops the game's six-character tags and uses the game's full 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. Perhaps these categorizations relate to later, well-recognized computer game genres. But it would be hard to fit 10 PRINT into any category except "Introductory Fun" or (as ''RUN'' did) "One-Liner." | + | 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. |
| − | No doubt aware of the momentum building in the growing community of users of the BASIC language, Ahl encouraged his the programmers who were reading his book to submit games for publication in books and future issues of his magazine, ''Creative Computing''. He urged 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 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. |
| − | Later in 1978, Workman Publishing took 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. | + | 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.'' |
| − | Another significant volume was Bob Albrecht's large-format ''What To Do After You Hit Return, or P.C.C.’s first book of Computer Games,'' first published in 1975 by People's Computer Company. It was handed off to a series of other publishing entities and underwent several printings. Hayden Books began printing it in 1977; its 5th printing in 1979 was still printed inexpensively on newsprint paper. | + | 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. |
| − | Given the growing popularity of BASIC and computers among hobbyists, it is not surprising to see other, presentations of BASIC such as ''The Little Book of BASIC Style. How to write a program you can read'', written by John M. Nevison and self-published by John M. Nevison Associates in 1978. This book insists that programs have human readers and, as the preface explains, evokes the simplicity of the ''Elements of Style'' by E. B. White. | + | 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. |
| − | |||
| − | On the other hand there are introductions to programming that make extensive use of BASIC as the language of choice: One was the 1979 ''Programming for Poets. A Gentle Introduction Using BASIC'', simplified textbook; another was 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 others. Charles D. Sternberg’s ''BASIC Computer Programs for the Home'' (1980) is one such book, whose specific aim was to satisfy "the practical requirements of the home." The author 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. | ||
== BASIC Code in Human Memory == | == BASIC Code in Human Memory == | ||
| − | It is hard enough these days 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 programs were indeed transmitted in this way, and people are still invited to key in code snippets of different sorts from books on programming. | + | 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, got from computer to computer and from person to person: by being memorized. The claim here is not that the early 1980s presented a ''Fahrenheit 451'' situation in which the world's great computer programs were preserved by a dedicated few, but that it was common for people who knew a bit of programming to keep a one-liner, or even a handful of short programs, in mind so that they could be typed into a friend's computer. Very short programs that did visually interesting things were particularly worth memorizing; in the late 1970s and early 1980s, the mass of these were in BASIC. (See "Remarks: One-Liners" for many examples.) And since programmers typically had to memorize certain BASIC statements, such as <code>? CHR$(147)</code> (which clears the screen), it was not much of a leap to memorize two statements in that language, such as <code>10 PRINT CHR$(205.5+RND(1)); : GOTO 10</code>. | + | 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 <code>? CHR$(147)</code> (which clears the screen), it was not much of a leap to memorize a program that contained two statements in that language, such as <code>10 PRINT CHR$(205.5+RND(1)); : GOTO 10</code>. |
| − | 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, 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. | + | 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. |
| − | |||
| − | 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 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. | 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. | ||
| − | 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. | + | 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 <code>dosfile.txt</code> 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 <code>perl -p -i -e 's/\r\n/\n/g' dosfile.txt</code> 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": <code>perl -p -i -e 's/Atari/Commodore/g' manuscript.txt</code>. |
| − | Ruven Brooks published a more elaborate theory of program comprehension in 1983; 10 PRINT shows some interesting ways in which this theory breaks down. In Brooks's theory, a programmer reconstructs knowledge about the real-world domains that the program models, developing an initially underspecified hypothesis and refining and elaborating it "based on information extracted from the program text and other documentation." (p. 543) Brooks posited the useful idea that certain lines were "beacons," specially indicating program structures and operations. (p. 548) But his theory is otherwise difficult to apply to 10 PRINT. Brooks lists seven internal and five external "indicators for the meaning of a program," such as "Indentation or pretty-printing" and "Flowcharts." (p. 551) None are present for the one-line program we are discussing here. More fundamentally, Brooks's model is for programs that simulate business processes, not computer programs in general. He introduced a shipping domain in his paper, but then noted that "If the task is to implement a general algorithm for a general purpose routine, say a matrix inversion subroutine, there will be no domain corresponding to the original domain of cargoes and routes." (p. 545) In fact, the problem is not just with abstract processes and mathematical routines. Brooks's model cannot directly apply to any creative production that is done by programming the computer, unless it happens to also have a business-style real-world domain. What is the "cargoes and routes"-style domain of games, recreational programming, art, music, obfuscated code, or productions such as demos and intros in the demoscene? | + | 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 (<code>s///</code>) 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. |
| − | 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) | + | 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. |
| − | 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. | + | == Studies of Program Memorization (Sidebar) == |
| − | The point here is not to advance an alternative theory of program memorization, but to show that 10 PRINT represents a category of programs that were historically memorized but which existing theories of program memorization, created for longer 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 type done in these memorization studies, but it may also relate to the way people memorize jokes, proverbs, and other folk texts. These studies do at least show how people can remember key statements (beacons) and the high-level workings of a program without memorizing it character by character. Also, the appearance of program variants that work identically but are written differently is consistent with studies on and theories of program memorization. And, essentially, the studies demonstrate that program memorization is possible and that many people may have carried 10 PRINT into a Commodore 64's memory by using their own. | + | 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). |
| − | == Remembering 10 PRINT (Sidebar) == | + | 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''' | '''by Nick Montfort''' | ||
