BASIC

From Maze

(Difference between revisions)
Jump to: navigation, search
(→Dartmouth BASIC and Time-Sharing Minicomputers)
(→Dartmouth BASIC and Time-Sharing Minicomputers)
Line 22:Line 22:
The original version of BASIC introduced another concept to programming that is readily apparent in 10 PRINT: the line number. Prior to BASIC, computing jobs were performed by batch processing. A program consisted of a stack of IBM keypunch cards, submitted to the computer. Multiple programs would be feed into the computer, which would then execute them one-by-one, printing out the results. When all of the programs had been run, another batch could be given to it. Any error in any keycard would result in an unexecutable program; debugging was a long and painful process. Line numbers solved the problem, or at least made it easier to pinpoint errors. An error in a program meant only the offending line had to be retyped, rather than an entire keycard repunched.
The original version of BASIC introduced another concept to programming that is readily apparent in 10 PRINT: the line number. Prior to BASIC, computing jobs were performed by batch processing. A program consisted of a stack of IBM keypunch cards, submitted to the computer. Multiple programs would be feed into the computer, which would then execute them one-by-one, printing out the results. When all of the programs had been run, another batch could be given to it. Any error in any keycard would result in an unexecutable program; debugging was a long and painful process. Line numbers solved the problem, or at least made it easier to pinpoint errors. An error in a program meant only the offending line had to be retyped, rather than an entire keycard repunched.
 +
 +
The concept of line numbers was so unconventional at the time that the original BASIC instruction manual from 1964 went into some detail concerning their use: line numbers must be "no more than five digits," "contain no spaces or non-digit numbers," and finally "start at the very beginning of the line" (17-18)--all restrictions that modern users might take for granted but at the time were hardly self-evident. It's difficult to overstate the value of line numbers to BASIC. Line numbers were not simply after-thoughts to the language, they were constitutive of the language itself, part of its very ethos. For example, line numbers made it easy to delete existing lines; simply type the line number without any further instructions, and the line disappears. To correct a single existing line, rewrite 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 <ins>not</ins> 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.
 +
 +
This convention makes several of the variations of 10 PRINT found "in the wild" stand out. For example, the three-line version in the C64 User Manual skips line 30, an intriguing absence that has no bearing on the program's process but which nonetheless stands out when the program is LISTed. The irregularity of the line numbering in this instance is particularly striking because the very same C64 manual 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). Likewise, the one-line variant of 10 PRINT found in an issue of ''Run'' from 1984 begins with the line number 8, a seemingly arbitrary line number that obviously defies the increment of ten "good programming practice." Is this irregularity actually arbitrary though? Taken in context of the entire program--
 +
 +
8 PRINT CHR$(205.5 + RND(8)); : GOTO 8
 +
 +
--one wonders if the odd (that is, even) line number is meant to create further mystification about the program's purpose. It's easy to imagine a novice to BASIC confusing the function of the 8's that bookmark the program with the third 8 embedded in the RND function. Understood this way, the line number 8 becomes precisely want the creators of BASIC hadn't intended: an aesthetic device, creating a visual internal symmetry within the program.
 +
 +
In 1985, the developers of BASIC argued that "until the appearance of modern screen editors, the line-numbering system we devised was the easiest editing system available" (12). It's worth nothing that the Commodore 64 sat at the cusp of line-numbering editing and visual screen editors. It ''was'' possible with the C64 to edit a line of BASIC without retyping the entire line. Using a combination of SHIFT, ARROW, and INST/DEL keys, it was easy enough with the Commodore to edit a few characters of a line. One can't help wonder whether this move toward visual line editing, though a boon to programming in general, was an anathema to the ethos of BASIC, a sign of proliferating complexity.
== Altair BASIC and Microcomputers==
== Altair BASIC and Microcomputers==

Revision as of 19:46, 30 March 2011

View this revision of BASIC.

Personal tools