Saturday, January 29, 2005

Objects and BASIC?

As an implementor of a BASIC language ( I have a lot of people write me with their suggestions. This is a great thing. Some people ask for object oriented features. I know this is all the rage, and I understand object oriented programming well because I've been programming in Smalltalk since 1988, and Java for 3 years. Smalltalk is the first modern object oriented language, and a darn good one.

Here's the problem. BASIC was not conceived as an object oriented language. Just as many implementors of contemporary BASICs have made the language unrecognizable by piling the features of C and other languages on top of it, an object oriented BASIC risks becoming some other language entirely.

Any really good object oriented language is objects all the way down. In these languages (Smalltalk and Self for example) even numbers, strings, and boolean values are objects. Everything is treated uniformly. It would be a supreme challenge to redesign BASIC so that it had this kind of uniformity. It just wouldn't look like BASIC anymore. :-(

This doesn't mean that BASIC couldn't be extended to have some object oriented ideas. To do so it would be important to identify what the simplest and most useful ideas of objects are, and to invent a very small syntax extension for the BASIC language to support these ideas. I think any object oriented extensions should be simple and consistent enough to be learnable in five minutes. The goal should be maximum bang for minimum buck. Otherwise, why bother when there are already so many other object oriented languages?