Computers And Society
David D, Thornburg, Associate Editor
Beyond BASIC
One topic that can always be counted on to fill my mailbox with angry responses is the replacement of BASIC by other languages. Based on the responses I received last March, many personal computer users seem convinced that BASIC is the only computer language we will ever need, and that attempts to replace BASIC with something else will somehow destroy the nature of personal computing.
If I had a dime for each letter I receive telling me how "good" BASIC is, I could probably retire soon. To pick just one example of blind support for BASIC, I overheard a salesman at a major computer retailer tell a customer that he should buy Logo for his kids and use BASIC for his own programming. After the confused (and seriously misinformed) customer left, I asked the salesman if he knew what he had done. I told him that he might as well have said that the customer should buy a Porsche for his kids and a rusty bike for himself.
I think one reason people get so defensive about BASIC is that they don't want to feel that their own investment of time and energy has been wasted. This is a natural and completely understandable response.
Not A Wasted Investment
It is important that BASIC users realize that their investment won't be wasted as they learn new languages. A knowledge of BASIC (or any other computer language) not only eases the learning of new languages, but also helps the user grasp the features of new languages.
I know this to be true because I, too, was once a BASIC enthusiast. My initial enthusiasm for BASIC arose from my reluctance to learn machine language (I'm really not a bit-twiddler at heart), and from the absence of any other high-level language for personal computers.
While the use of BASIC on personal computers is largely an accident of history, it offered the beginning personal computer user a smorgasbord of features—a little arithmetic, a little string manipulation, a little screen formatting, etc. Infact, BASIC was designed to be a jack-of-all-trades (and a master of none). When compared with FORTRAN (the language from which BASIC was derived), BASIC was clearly the better choice for first-time programmers—especially if they were not going to become computer scientists.
Freedom Of Choice, Finally
But, like almost everything else, languages do not stand still. Since 1978, quite a few alternatives to BASIC have appeared on personal computers. One of the highlights of the personal computer industry occurred when Atari decided to sell computers without a built-in language. The freedom of choice this offered the user was most refreshing. Unfortunately, most other manufacturers of home-based personal computers still give BASIC "free" (you pay for it—don't worry about that!) with the purchase of the computer.
As I became more interested in languages like PILOT, Logo, and PROLOG, I kept trying to identify one aspect of these languages that made them more appealing to me than BASIC. On the surface they are all quite similar: Programs in all four of these languages are collections of words and symbols. Each of these languages has a vocabulary and a grammar, and, on this basis, one may be tempted to argue that all languages are equivalent.
But this is not true. Without trying to be too philosophical, there is much to be said for the idea that the very nature of the things we think about is influenced by the language in which we do our thinking.
Languages Encourage Versatility
When this idea is applied to the computer, it suggests that the types of programs we create are influenced by the computer languages we use. This implies that, to be a versatile programmer, one benefits from knowing several computer languages. From my own experience, I find that this is true. I use Logo for most of my mathematical calculations, PILOT for text programming, and PROLOG for data base programs.
But my desire to be multilingual was not what pulled me from BASIC. Until recently, I had only a vague idea why I preferred other languages, or why I preferred parts of these languages over other parts.
I think I have finally found the key to understanding the fundamental differences between various computer languages, and their "ease of use" by casual programmers. Computer programs can be classified as either prescriptive or descriptive. A prescriptive program (or procedure) is one that tells the computer how to perform a computational task, and a descriptive program or procedure tells the computer what task to perform, without specifying how it is to be done.
Fundamental Distinctions
To my way of thinking, these distinctions are fundamental. By examining various computer languages on the basis of their prescriptive or descriptive nature, we can begin to see why some languages (or parts of languages) may be perceived as "friendlier" than others.
For example, the turtle graphics component of Logo is so popular that many Logo users remain blissfully unaware that Logo contains a very powerful list processing environment suitable for many exciting programming tasks. On closer examination, one finds that turtle graphics programs consist largely of descriptions of the tasks the turtle is to perform.
Many list processing programs, on the other hand, consist mainly of prescriptions telling the computer how to manipulate the text or other data on which the program operates. In PILOT, the match command (M:) allows the programmer to search for any set of characters or words inside a user's response without having to specify how this search is done. Neither BASIC, Logo, nor PROLOG has this feature. The match command is descriptive, not prescriptive.
The entire predicate calculus portion of PROLOG is descriptive. Not surprisingly, this aspect of PROLOG is starting to be explored by children with the ease and facility of Logo's turtle graphics.
Easy To Learn And Powerful
This all suggests that descriptive languages are easier to learn than prescriptive languages. Based on the kinds of programs that can be created with PILOT, Logo, and PROLOG, it is also clear that a descriptive environment is no less powerful than a prescriptive one.
While all languages presently used with personal computers have prescriptive components, it is exciting to imagine the creation of purely descriptive languages. By freeing us from the arduous task of telling the computer how to perform the chores we want it to carry out, we become free to tell the computer what we want it to do instead.
This descriptive component of newer languages will, more than anything else, allow us to move well beyond BASIC in the future. I once predicted that BASIC would be displaced as the language of choice for nonprofessional programmers within five years. One year has passed, and there are indications that this prediction is still on target.
I realize that many of you may remain unconvinced. You should try PILOT or Logo for a while (I would encourage you to try a nonprocedural language like PROLOG, but it is still hard to find in the United States). Once you have spent a few days away from BASIC, let me know what you think. Remember that there is no perfect computer language, but PILOT, Logo, and PROLOG may be pointing to a new model for computer programming that will make the power of the computer accessible to all who care to use it.
David Thornburg's other column "Friends of the Turtle" will reappear later this year.