Friday, March 04, 2005

What Defines BASIC?

When you think of BASIC, what comes to mind?

What is the core language itself? I implemented Liberty BASIC from what I considered to be the essentials of the language. I am not a VB programmer. My own experience programming in BASIC comes mostly from these influences:

* Benton Harbor BASIC
* TRS-80 BASIC
* Applesoft BASIC
* Commodore BASIC
* MBASIC
* GW-BASIC

Except for Benton Harbor BASIC, these are early flavors of Microsoft BASIC. They all use line numbers and have these commands in common: LET, PRINT, INPUT, GOTO, GOSUB, RETURN, READ, DATA, IF/THEN, FOR/NEXT, DIM, OPEN, CLOSE, etc. There are also functions like VAL, SIN, LOG, LEN, MID$, LEFT$, RIGHT$, STR$, etc.

They are also all command line interpreters. This is an important feature that is mostly lost in modern BASICs. The interactivity of the language is one of the things that makes it approachable and easy to learn. Most newer BASICs are not interactive, including my own. I'm working on a new BASIC which adds interactive features.

So is there a BASIC standard? In fact there is an ANSI standard, developed by a commitee. This standard BASIC is largely ignored by the community of BASIC implementors. Microsoft has been the biggest influencer in the BASIC space, and their QBasic became the defacto standard for BASIC. Visual Basic has not been able to overcome QBasic's popularity for the casual user and hobbiest. Perhaps QBasic's inclusion of an immediate mode (approximating a command line interpreter's interactivity) is one of the reasons why it is Microsoft's last real BASIC?

I'm interested in your feedback on this. My own thoughts are:

* BASIC has a small core of classic commands. Learn these commands and you should be able to be productive in any version of BASIC in five minutes, or it isn't BASIC.
* New commands should be added with reluctance.
* BASIC programmers should not be required to use GUI elements in their programs.
* The BASIC coder should not have to understand C data types to write a program.
* BASIC should be interactive by use of a command line or other innovative features.
* Extensions to any BASIC should not feel like some completely different language so that someone who knows BASIC looks at code written in that dialect and says, "What the HECK is that?!!"

Your thoughts?