The BASIC (Beginner’s All-purpose Symbolic Instruction Code) language was developed by J. Kemeny and T. Kurtz at Dartmouth College in 1964. At the time, the college was equipped with a time-shared computer system linked to terminals throughout the campus, an innovation at a time when most computers were programmed from a single loca-tion using batches of punch cards. John G. Kemeny and Thomas Kurtz wanted to take advantage of the interactivity of their system by providing an easy-to-learn computer lan-guage that could compile and respond immediately to com-mands typed at the keyboard. This was in sharp contrast to the major languages of the time, such as COBOL, Algol, and FORTRAN in which programs had to be completely written before they could be tested.
Unlike the older languages used with punch cards, BASIC programs did not have to have their keywords typed in specified columns. Rather, statements could be typed like English sentences, but without punctuation and with a casual attitude toward spacing. In general, the syntax for decision and control structures is simpler than other lan-guages. For example, a for loop counting from 1 to 10 in C looks like this:
for (i = 1; i <= 10; i++) printf(“%d”, i);
The same loop in BASIC reads as follows:
for i = 1 to 10 print i
next i
Unlike the older languages used with punch cards, BASIC programs did not have to have their keywords typed in specified columns. Rather, statements could be typed like English sentences, but without punctuation and with a casual attitude toward spacing. In general, the syntax for decision and control structures is simpler than other lan-guages. For example, a for loop counting from 1 to 10 in C looks like this:
for (i = 1; i <= 10; i++) printf(“%d”, i);
The same loop in BASIC reads as follows:
for i = 1 to 10 print i
next i
Basic and Microcomputers
During the 1960s and 1970s BASIC was used on a growing number of time-sharing computers. The language’s simplic-ity and ease of use made it useful for writing short utility programs and for teaching basic principles of computing, particularly to noncomputer science majors. When the first personal computers became widely available in the early 1980s, they typically had memory capacities of 8KB–64KB, not enough to run the editor, compiler, and other utilities needed for a language such as C. However, a simple inter-preter version of BASIC could be put on a read-only memory (ROM) chip, as was done with the Apple II, the early IBM PC, and dozens of other microcomputers. More advanced versions of BASIC (including compilers) could be loaded from tape (the first sales by a young entrepreneur named Bill Gates consisted of such products).
As a consequence of the adopting of BASIC for a variety of microcomputers, numerous dialects of the language came into existence. Commands for generating simple graphics and for manipulating memory and hardware directly (PEEK and POKE) made many BASIC programs platform specific.
Gradually, as microcomputers gained in memory capac-ity and processing power, languages such as Pascal (espe-cially with the integrated development environment created at the University of California at San Diego) and C (from the UNIX community) began to supplant BASIC for the development of more complex microcomputer software.
Critique and Prospects
Most versions of BASIC used line numbers (a legacy of the early text editors that worked on a line-by-line basis) and a Goto statement could be used to make program control jump to a given line. While the language had simple subrou-tines (reached by a Gosub statement), it lacked the ability to explicitly pass variables to a procedure as in Pascal and C. Indeed, all variables were global, meaning that they could be accessed from anywhere in the program, leading to the danger of their values being unintentionally changed.
As interest in the principles of structured programming grew (see structured programming), BASIC’s structural shortcomings made it poorly regarded among computer sci-entists, who preferred Pascal as a teaching language and C for systems programming. In 1984, BASIC’s original devel-opers responded to what they saw as the problems of “street Basic” by introducing True BASIC, a modern, well-structured version of the language, and the 1988 ANSI BASIC stan-dard incorporated similar features. These efforts had only limited impact. However, Microsoft introduced new BASIC
development systems (Quick BASIC in the 1980s and Visual Basic in the 1990s) that also featured improved control structures and data types and that dispensed with the need for cumbersome line numbers. Visual Basic in particular has achieved considerable success, offering a combination of the interactivity of traditional BASIC and access to pow-erful pre-packaged “controls” that provide menus, dialog boxes, and other features of the Windows user interface. Recent versions of Visual Basic have become increasingly object-oriented, using classes similar to those in C++.
While BASIC in its newer forms continues to have a significant following, it can be argued that what was most distinctive about the original BASIC (the quick, interactive approach to programming) is no longer much in evidence. The writing of short utility programs is now more likely to be undertaken in any of a variety of scripting languages.
No comments:
Post a Comment