BASIC

From Maze

(Difference between revisions)
Jump to: navigation, search
(→Tiny BASIC and Copyleft)
(→Dartmouth BASIC and Time-Sharing Minicomputers)
Line 47:Line 47:
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 esoterics of programming languages but also to the material nature of programming. 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 p. 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 p. 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 p. 81) This aspect of Dartmouth BASIC was carried over onto the Commodore 64, as mentioned in the introduction.
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 esoterics of programming languages but also to the material nature of programming. 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 p. 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 p. 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 p. 81) This aspect of Dartmouth BASIC was carried over onto the Commodore 64, as mentioned in the introduction.
−
BASIC was designed to help new programmers in other ways, 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.
+
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). Since BASIC was meant to be a true high-level language, programmers would not need any detailed knowledge of the specific hardware being used either. Programmers who invested time in learning BASIC could port most of their skills between platforms, allowing them to focus more on application than low-level hardware.
While BASIC didn't require programmers to put things in certain columns, there was a requirement that something be put at the beginning of each line: a line number, such as "10." This facilitated branching, of course; the GOTO and GOSUB statements refer to the line numbers where program flow should continue. BASIC did not actually need line numbers for this purpose, however. Labels, such as those used in assembly, would have sufficed, and indeed they do suffice in later versions BASIC that do not use line numbers. The line number's real value is seen on a Teletype or other print terminal, or in any environment where full-screen editing is not an option. Line numbers made it easy in those cases to delete existing lines; simply type the line number without any further instructions, and the line disappears. To correct a single existing line, just retype a line with the same line number. To see what a particular line, say line 50, currently is, "LIST 50" will do the trick -- although if one had written the line recently, one could also look up or literally "scroll" back to where the line had been printed out.
While BASIC didn't require programmers to put things in certain columns, there was a requirement that something be put at the beginning of each line: a line number, such as "10." This facilitated branching, of course; the GOTO and GOSUB statements refer to the line numbers where program flow should continue. BASIC did not actually need line numbers for this purpose, however. Labels, such as those used in assembly, would have sufficed, and indeed they do suffice in later versions BASIC that do not use line numbers. The line number's real value is seen on a Teletype or other print terminal, or in any environment where full-screen editing is not an option. Line numbers made it easy in those cases to delete existing lines; simply type the line number without any further instructions, and the line disappears. To correct a single existing line, just retype a line with the same line number. To see what a particular line, say line 50, currently is, "LIST 50" will do the trick -- although if one had written the line recently, one could also look up or literally "scroll" back to where the line had been printed out.

Revision as of 20:47, 11 July 2011

View this revision of BASIC.

Personal tools