Programming experiences with BASIC

It was somewhere in the early 80s when the emergence of home computers like the Commodore-64, the Atari or the MSX also heralded the emergence of educational programs. As a new teacher that appealed to me, and when a Commodore-64 finally came to school, I sat in all afternoon breaks with that thing in front of me. Not only to play, but especially to see if I could make the thing do what I wanted. Because, of course, that's what it was about. The first frequent response of the thing was the message: syntax error. But that didn't make me beat me out of the field.

When I purchased a home computer myself shortly afterwards, I went for the MSX because the MSX-DOS operating system was to some extent compatible with MS-DOS, which was used for the emerging PCs. And I hit programming. The home conputers were standard equipped with a version of BASIC (Beginner's All-purpose Symbolic Instruction Code) that could be programmed.

The advantage of BASIC was the relative readability and ease with which you could jump from instruction to instruction. That was also the disadvantage. Basic programs work with line numbers. An example:

10 Print'Hello World'

20 Print'Welcome to Digital Time'

A simple program that does nothing but display two lines on the screen:

Hello World

Welcome to digital time

You can see that the line numbers always raise 10. That was a default setting and that made it possible that you could easily insert intermediate instructions with an intermediate line number.

So in a simple program you could easily jump to a certain line with, for example, the code: GOTO 20. That is, the program should process the instruction of line 20 as follows. If this is your program:

10 Print'Hello World'

20 Print'Welcome to Digital Time'

30 goto 20

then the line 'Welcome to Digital Time' will be repeated endlessly.

The many 'GOTO' and 'GOSUB' instructions were also devastating for the readability.

Many computer languages work with a compiler. Such a compiler converts the human instructions into code, which can be processed by a computer. After that, the computer no longer needs the 'readable' program rules and can quickly process the code. BASIC does not work with a compiler but with an interpreter. It interprets the 'readable' instructions and then executes them. A BASIC file containing the program rules will therefore not be able to work on a (other) computer, if there is no BASIC installed on it, and also of the same type and version. Because there were, of course, different versions of BASIC available on all these computers from different manufacturers. Because every Basic rule has to be interpreted over and over again, the processing was slower and the program itself slower. In my case, BASIC was a great programming language to start with. However, the interchangeability was a problem, and the speed was also too — especially for more complicated graphics applications.

I myself switched to PASCAL, in particular TURBO-PASCAL, and later to DELPHI (a more graphical version based on Turbo-Pascal). A lot faster and more readable!

(c) 2021 Hans van Gemert