Chad Perrin: SOB

29 July 2009

Language Deathmatch: Basic vs. Logo

Filed under: Geek — apotheon @ 05:17

(addendum: I’ve also written Language Deathmatch: Small Basic vs. UCBLogo, for those who are interested in my take on such an implementation vs. implementation comparison.)

Google has announced the development of a BASIC variant called Simple, aimed at being an LFM, and intended for use in Android development. My initial reaction was “Why BASIC?” This feels surprisingly like a case of those who are ignorant of history, or at least in denial about it, being doomed to repeat it. Why use a crappy LFM reputed for its encouragement of bad habits, instead of one that is also clearly an LFSP?

(For more about the difference between LFMs and LFSPs, you could take a break from this to read Michael Vanier: LFM and LFSP. If you already need a break from this, though, there’s something wrong.)

A few people in reddit discussion disagreed with me, but that’s not exactly a very good venue for developing a clear comparison of BASIC and Logo for the purpose of demonstrating the unsuitability of yet another BASIC variant for educational purposes when better options are available.


BASIC, influenced by ALGOL and FORTRAN, was created by John George Kemeny and Thomas Eugene Kurtz to serve the purpose of an educational programming language for people who weren’t science students. In the 1980s, it shipped with quite a few home computers, and was as a result the first programming language many people — including me — encountered and used.

Initially, there was not much of a natural learning path from BASIC to other languages. In the ’80s and ’90s, however, some more powerful descendants of BASIC have been developed, most notably including Microsoft’s Visual Basic.


The LISP family of languages — including Scheme and Common Lisp — also includes Logo. Where Common Lisp never pretended (as far as I’m aware) to be anything other than a language for experts, Scheme was created specifically as both a simplified notation for demonstrating principles of computer science and a practical programming language that can be used to get Real Work™ done. Beneath the level of Scheme, however, lies Logo, which was specifically created as an educational language for children.

The inventor of Logo, Seymour Papert, said in Redefining Childhood: The Computer Presence as an Experiment in Developmental Psychology, that:

[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.

Logo was designed from the very beginning as a means of not just handing data to children and expecting them to memorize it, but giving children the tools of autodidactism and helping enable them to explore new concepts and learn new things for themselves. That’s a pretty good beginning, I think. In addition to that, however, there is also a natural path of progression from Logo to Scheme or Common Lisp, and the wealth of excellent computer science texts and classes that use Common Lisp and especially Scheme as tools of learning ensures that there’s always more to be learned with a minimum of additional preparation by moving to a drastically different, more capable language.

Even better, there are dialects of Logo itself that are suitable for much the same uses as Scheme and Common Lisp (though they tend to lack library support). UCBLogo in particular is a stand-out example of excellence, going so far as to provide even metaprogramming macros, and is far from the only Logo dialect to do so. Logo has also been adapted to other uses, such as LEGO Mindstorms programming — and what’s more educationally encouraging in a programming language than the ability to program your LEGO blocks?

Logo’s initial design was optimized for use controlling robots, including a device called a “turtle” that could be made to wander around on the floor drawing lines like a particularly high-tech Etch A Sketch. Since then, a turtle graphics feature has been added to most Logo implementations, allowing the educational value of the turtle to be included with Logo even where a physical turtle is impractical, adding an even more immediate educational feedback capability to the language implementation.

In some respects, unfortunately, Logo has been a victim of its own success as an educational language aimed at children. It is, in fact, a better designed general purpose language than many languages that have been used professionally by adults for many years, but it is still regarded largely as a “toy” that’s only suitable for children. Turtle graphics in particular has been both a great boon to people who wish to introduce children to programming concepts and a limiting factor for the recognition of the Logo language itself, as most people who have heard of Logo seem unable to even distinguish between turtle graphics and the Logo language itself.


Truth be told, I can’t even think of anything bad to say about Logo. It even manages to overcome the common complaint about LISP languages by being less cryptic in the names of its language primitives, and in eschewing parentheses for simple operations.

Meanwhile, famous computer scientist Edsger W. Dijkstra has had some well-known harsh words to offer about BASIC, in EWD898: The threats to computing science:

I think of the company advertising “Thought Processors” or the college pretending that learning BASIC suffices or at least helps, whereas the teaching of BASIC should be rated as a criminal offence: it mutilates the mind beyond recovery.

He has said so on more than one occasion. In EWD498: How do we tell truths that might hurt?, he said:

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

This may be a bit of hyperbole (at least I hope so, for my own sake), and he has had similarly scathing things to say about APL, COBOL, and FORTRAN. One might wonder if he just hates languages whose names are acronyms or initialisms.

Still . . . if his intent was to point out that BASIC suffers some deeply troubling issues — particularly as an educational language — he’s right. He’s especially right when BASIC is compared to other possibilities, such as Logo.

Some comparative benefits and detriments of each language follow:

  • Turtle graphics capabilities give Logo a significant advantage over BASIC for a low bar to entry.

  • Old-school BASIC is a line-oriented programming language that doesn’t just fail to provide any more advanced capabilities for students who have moved beyond the most simplistic early stages of learning to program, thus limiting the amount of continuous progress one can make before having to change tools, but even specifically encourages bad programming practice. The addition of arbitrary labels to make goto statements easier to use is far from an ideal way to teach people to program well.

  • A good Logo implementation, as an effectively feature-complete LISP, scales upward indefinitely. Aside from specific descendants of BASIC that are not even recognizably BASIC any longer, BASIC doesn’t scale up at all, really.

  • The complete inability to avoid doing anything in a global scope in early BASIC dialects is substantially limiting, to put it kindly.

  • Visual Basic, despite being an unrecognizably modified variant of BASIC, still suffers serious shortcomings (yes, some of those have changed in recent versions, but other problems have arisen). Worse yet, in order to solve the problems of more primitive, older dialects of BASIC, it has utterly ceased to be an appropriate tool for education of young children.

  • To “solve” the problem of modern BASIC descendants that are unsuitable to use as educational languages for children, Microsoft has come up with Small Basic. It is indeed a greatly simplified language, easy for young people to pick up quickly, but it has unfortunately reached that point only by having most of the benefits of other modern BASIC descendants cut out of it.

  • Logo to Scheme and/or Common Lisp provides a more natural growth path than BASIC to any modern BASIC descendant that is actually good for anything in the Real World™.


I think that pretty well sums it up. I’ll add additional notes if I get any comments that warrant inclusion. As things stand, though, I can’t think of a single reason to favor BASIC over Logo as an educational language.

All original content Copyright Chad Perrin: Distributed under the terms of the Open Works License