BASIC vs Logo

From WikiVS, the open comparison website
Jump to: navigation, search

BASIC (an acronym meaning Beginner's All-purpose Symbolic Instruction Code) and Logo are two well-known programming languages designed in the 1960s for educational purposes. Both have achieved success particularly among children in primary school settings and on home computers.

Development and Philosophy[edit]

Each of BASIC and Logo was developed with educational purposes in mind, but they had divergent specific aims within that umbrella purpose, and differing philosophies of education.

BASIC Design[edit]

John George Kemeny and Thomas Eugene Kurtz were influenced in part by ALGOL and FORTRAN when designing the BASIC language at Dartmouth College in 1963. Their purpose was to create a language suitable for teaching elementary programming concepts to college students who were not science students, when programming was dominated by science. The requirements they sought to fulfill when designing the language include:

  1. easy for beginners to understand and use
  2. general-purpose programming language
  3. allow addition of advanced features for experts
  4. provide an interactive programming experience
  5. clear and friendly error messages
  6. respond quickly for small programs
  7. require no deeper understanding of the computer hardware
  8. require no deeper understanding of the operating system

Logo Design[edit]

In 1967, Seymour Papert developed Logo as an educational dialect of LISP intended to help children learn. The idea was not simply to help them learn programming, however, but also to help them learn to learn, and encourage them to seek out new learning experiences on their own. Where Scheme is a LISP dialect that was originally designed to aid college students' learning of computer science concepts, Logo was specifically targeted to a much younger audience. In Redefining Childhood: The Computer Presence as an Experiment in Developmental Psychology, Papert explains his intent:

[M]ore important than having an early start on intellectual building is being saved from a long period of dependency during which one learns to think of learning as something that has to be dished out by a more powerful other. Children who grew up without going through this phase may have much more positive images of themselves as independent intellectual agents. Such children would not define themselves or allow society to define them as intellectually helpless.

As an early tool for encouraging learning and rapid feedback, Logo was designed to interact with a small robot called a "turtle" whose movements could be controlled through directives built into the Logo language. The turtle included a pen device that could be used to draw lines on the surface over which it moved. Later implementations of Logo provided implementations of a graphics library known as "turtle graphics" that allowed the same control over a (virtual) robot that could create images on the screen of the computer.

Design Success[edit]

The success of the design and evolution of an educational language can be measured in a number of ways. Among them are:

  • meeting design goals
  • providing a natural and productive learning path

Design Goals[edit]

Both BASIC and Logo have satisfied the bulk, if not all, of the requirements set out by both language designers. The degree to which they have succeeded at each point may vary, however.

BASIC Goals[edit]

It can be argued that BASIC achieved the goals of both the designers of BASIC and the designer of Logo, to varying degrees:

  1. It has proven much easier for beginners to understand and use than the majority of other programming languages -- particularly common languages in the days when BASIC was designed.
  2. It is not specifically aimed at a particular niche programming purpose, except to the extent that the particular design goals for the language can be said to constitute a niche, and it is capable of being used for most if not all programming purposes with roughly equal facility. Only its unsuitability for development of significant size tends to limit its generic appeal.
  3. The success of the core BASIC language in allowing for advanced features to be added could be a matter of some dispute. Significantly modified dialects of BASIC, some so different from both the original and the ANSI standard that they cannot even reasonably be called another implementation of the original language, certainly do provide more advanced capabilities. Any attempts to include such features in the language tend to damage BASIC's ability to satisfy the other design requirements Kemeny and Kurtz set for themselves, with rare exceptions.
  4. The interactivity of BASIC is achieved largely by virtue of the quick turn-around time between writing code and running it. Its initial implementation at Dartmouth College was as a one-pass compiler on an interactive time-sharing system, at a time when almost all computing was done on batch systems. Many other early implementations were interpreters.
  5. The clarity and friendliness of error messages varies greatly between implementations, of course, though the original BASIC language (now generally known as Dartmouth BASIC) did tend to provide much more beginner-friendly error message than the common programming languages of the time.
  6. In the intepreted implementations of BASIC, quick response for small programs was achieved at the expense of much slower execution for larger programs. How much this applies to each of the versions, variations, and implementations depends on the specific BASIC dialect and implementation, of course.
  7. The original BASIC implementations offered a high-level language that provided significant abstraction from the specific hardware on which it ran.
  8. Operating system abstraction and agnosticism in the design of the language itself, from the point of view of the programmer, was near-perfect for original implementations, though some later descendants do not insulate the user nearly as much from specifics of the operating system environment.
  9. The goal of encouraging students to explore and learn, set forth by Seymour Papert for the Logo language, was met by BASIC to the extent that it interested students in using the language. As an exploratory, learning activity in itself, when pursued outside the realm of strict deadlines and requirements for projects that are well-understood by the developer, simply encouraging people to program meets Papert's requirements to at least some degree. BASIC does require a nontrivial amount of early guidance, however, to get started.

Logo Goals[edit]

Logo can also be said to have achieved the goals of the designers of both languages:

  1. The initial ease of understanding and using the Logo language itself is probably about equivalent to that of BASIC, with variations depending on the preferences and habits of thought of the individual student. The gratifying, instant, visual feedback of turtle graphics libraries (and the original turtle robot) improved on the quick encouragement of students and rapid accumulation of understanding of how the language worked, however, providing it with a notable advantage early on. While a few later BASIC dialects have included a turtle graphics package as well, the inclusion of such capabilities is standard for Logo dialects.
  2. Logo's suitability for programming for a variety of purposes is substantial, in terms of its semantic and syntactic design, and may offer as much suitability for scaling up to larger projects as any other dialect of LISP. It is arguably more specifically suitable to educational purposes than BASIC, though, and the fact it has not been adapted to "serious" programming purposes to anywhere near the same degree as BASIC means it lacks the sort of library support modern programmers generally expect from a general purpose programming language.
  3. While specific Logo implementations may vary in regards to the exact selection of advanced language features, they share a simple core language structure with a small set of language primitives. The primitives are the building blocks for a highly expressive language in the tradition of LISP. This, combined with the underlying list-processing semantics of the language, makes it possible to present both a very easy, uncomplicated initial learning experience and a highly advanced set of capabilities for more complex, abstracted development concepts without compromising the simplified educational character of the language. Various dialects such as UCBLogo even provide a metaprogramming macro facility.
  4. In addition to the sort of quick turn-around time between writing code and running it that comes from using an interpreted language, the LISP heritage of Logo also contributed to the common use of a REPL (Read, Eval, Print Loop) interface for directly, line-by-line interactive programming.
  5. Logo implementations tend to provide error messages as "friendly" as early implementations of BASIC. Because most, if not all, Logo implementations are specifically education-focused, this has tended to be a primary concern in the development of Logo implementations in general.
  6. Similar to most implementations of BASIC, quick response for small programs was achieved at the expense of slower execution for larger programs because of implementation as an interpreter rather than a compiler. Quicker response was achieved by way of REPL interfaces, however, and via turtle graphics (which might be termed a sort of REDL, or Read, Eval, Draw Loop).
  7. Logo is a high-level language that provides significant abstraction from the specific hardware on which it runs.
  8. Operating system abstraction and agnosticism in the design of the language itself, from the point of view of the programmer, is near-perfect. In fact, as a list processing language largely focused on functional paradigm programming, it may be regarded as more abstracted from the underlying OS than an imperative language such as BASIC.
  9. Seymour Papert's goal of encouraging students to explore and learn was well embodied by the design of the Logo language. It did not, in fact, even focus primarily on students who initially showed interest in programming per se, because its robot command syntax (initially for a physical "turtle", and later for turtle graphics) provided immediate feedback of a sort not tied to the dry textual interface associated with computer programming at the time Logo was created. The amount of initial guidance necessary to get started with Logo, with the use of turtle graphics, is fairly minimal, and adding only instruction in how to access the help system of most Logo implementations can allow the most motivated students to move far ahead of any structured, group educational program.

Preparation for More Programming[edit]

One of the most important successes of both languages is the tendency of each to motivate new programmers to learn more, and to prepare them for development above and beyond initial educational context. The number of people who encountered one language or the other as a child, became fascinated by the possibilities, and grew to be enthusiastic code hackers as adults, attests to the efficacy of both BASIC and Logo for motivating people to learn programming.

BASIC Programming Preparation[edit]

Originally, BASIC served to teach unstructured programming concepts in a rudimentary fashion, but relied on the availability of other programming languages and educational opportunities provided by or for those other languages to allow the student to "graduate" from BASIC to a more "serious" language. Over time, however, more advanced dialects of BASIC grew out of the original educational language.

This growth of newer, more expressive dialects of BASIC provided something of a learning path that led from simplistic implementations aimed more at people entirely new to programming, toward more complex implementations intended for hobby programmers with more expertise, and finally to descendants of BASIC that incorporated the most common advanced programming features of the day. The canonical example of a professional derivative of BASIC today is Microsoft Visual Basic .NET, which provides access to the extensive .NET pool of development libraries via Java-like library calls, application development facilities including operating system APIs, and an assumption that the developer will use the VB.NET object oriented development facilities of the language. It is so evolved from its roots as to be almost unrecognizable as a descendant of the original BASIC programming language, except where it is contrasted with other languages such as C#.NET and other .NET framework languages.

Unfortunately, the path from one end of the spectrum of BASIC-derived language power is not perfectly smooth. Up to a point, it seems like a natural progression -- moving from GOTO to GOSUB, then to GOTO with labels, and finally to structured procedure definitions, seems intuitive enough on some level. Beyond that, however, later languages derived from BASIC tend to introduce huge collections of functionality at a time, leaving no obvious and easy adjustment, especially as the new language features tend to accompany significant changes in the language's syntax necessary to accomodate the new semantics that were never envisioned in the original design of BASIC.

Similar issues attend progressing from some earlier dialects of BASIC laterally to other languages that are better suited to "serious" development. There are languages not derived from BASIC that might actually serve as better steps on the path of learning programming than moving to modern, professional BASIC-descended languages, such as perhaps Pascal (and ultimately some variant of Object Pascal). Still, the problem of adjusting to a new syntax and semantic structure of the language exists, though an argument could be made that a competent programmer should learn more than one family of language in any case. The problem that arises is largely of being effectively forced to change languages when the student may not wish to.

Logo Programming Preparation[edit]

The Logo language in its earliest incarnation provided not only a context and tool set for teaching both functional and imperative programming techniques, but also an introduction to the rudimentary concepts of robotics programming. Because it was a dialect of the LISP family of languages that, in some ways, more closely approximated the original intent of the LISP language -- which called for the use of an M-expression syntax -- than other extant variants of LISP, it also provided fairly substantial room for growth without having to change to other programming languages (and thus, other syntactic forms) before the student was ready to do so in the course of exploratory learning.

Other, more "advanced" dialects of LISP existed nonetheless, and served as obvious next steps for the student to take when he or she decided to move on. While the forms of LISP used at the time are now generally considered obsolete and largely unused, they were quite suitable as goals for the growth of the new programmer -- and they have been supplanted by two very expressive, capable languages that arose subsequent to Logo as the heirs apparent to the LISP tradition. One was Scheme, in the 1970s, and the other Common Lisp, in the 1980s and 1990s.

Scheme has become, in many respects, the canonical demonstration language for computer science concepts. Its creators incorporated it into their curriculum when teaching introductory computer science courses, and wrote what is essentially The Book on Scheme, The Structure and Interpretation of Computer Programs. Subsequent to that, Scheme has also been "scaled down" to high school curricula, and Logo has been "scaled up" all the way to use as the demonstration language for fundamental university computer science curricula via the UCBLogo implementation and the three-volume CompSci textbook series Computer Science Logo Style, so that Scheme and Logo overlap in the middle in their suitability for education.

Scheme also serves as a capable professional and academic development language, which as traditionally become the realm of Common Lisp among modern LISP dialects, particularly for artificial intelligence research. As a result, Scheme and Common Lisp overlap in the middle in their suitability for "serious" programming, similarly to the way that Logo and Scheme do for educational programming.

All three languages have nearly identical semantic structures, and their syntactic forms are substantially similar too -- with the biggest difference being between Logo and either of the other two, where in Scheme and Common Lisp slightly more cryptic names for common language primitives are the norm, and parenthetical grouping is mandatory because Scheme and Common Lisp do not adhere to Logo's notion of default numbers of parameters for a procedure or function.

The end result of languages with a very broad range of suitability to differing purposes, using nearly identical semantic structures and syntactic forms, is that there is a very natural and almost seamless path of progression for the programmer from complete beginner to consummate expert. This is accomplished without sacrificing notable language capability at any stage, and without giving up a suitably low bar for entry to any student.


Educational Success[edit]

"Serious" Programming[edit]

Direct Comparison[edit]