A post at Doug Peterson’s blog (A Different Time) sent me to a site that has a collection of old BASIC programs. And by old I mean the 1970s. I remember many of these programs as I was starting my programming career back then. One could take these programs and type them into their computer and run them. It was fun and we learned a lot. But I’ll tell you the language has changed a lot since then.
For example back then a comment was a REM statement. Short for REMARK of course. Today most version of Basic use a single quote to flag a comment. Today variable names can be of any length while back then one was limited to a single letter followed by a number or numbers. Variables were declared using a Dim statement as they are today but the type was specific by a $ for string, a % for integers and floating point numbers had neither of those special symbols. One can’t use them in variable names today of course.
Originally BASIC did not have subroutines as we know them today. We had the GOSUB statement which branched code to a line number (we don’t use line numbers at all any more) and a return statement brought the flow of execution back to the line after the GOSUB. There was no parameter passing and variables were basically global. There were functions of a sort. Those were defined in a single line like this:
180 DEF FNM(X)=X-8*INT((X-1)/8)
The functions were all named FN followed by some letter. Return values were loosely typed. It sure was easy to use though.
I’m looking though these old projects for ideas for updated versions to use with my current students. Some I will use with Visual Basic and some with C#. And just maybe some with TouchDevelep. Some things never get old.
Today’s versions of BASIC are both much more powerful and much more complicated than those early versions were. Stronger types, more powerful functions and subroutines, lots more flexibility in identifier names and real error handling. Small Basic is an attempt, and a good one, at returning in part to those simpler days. It still has more power and complexity but many things are much easier. Visual Basic is a very powerful professional level language and development environment. It too makes some things much easier than they were “back in the day” but in other ways the complexity can be intimidating and even frustrating for beginner. It seems to work well with my high school freshmen though as long as I stick to the basics.
I wonder how many people judge the idea of BASIC based on thirty (or forty) year old versions of the language? Today’s versions, especially Visual Basic are every bit as powerful and modern as Java or many other popular languages. And still easier to learn. I still like them.