BASIC is often dismissed as an inferior language compared to its successors. Common complaints are its use of line numbers, its heavy reliance on GOTO for execution flow, and its lack of a stack for local variables.
What many critics overlook is that at the time of its use (during the first wave of home computers), BASIC was not just a programming language; it was a full development environment, akin to an IDE. It’s a concept that’s hard to understand if you haven’t used it at the time, as it’s so different from how we use computers today.
As you turned on your computer, you would immediately1 see a BASIC prompt. This interface was where you did everything: it was your terminal, your text editor, and your debugger.
First, you could directly type commands, and it would work like an interactive shell, which was great for learning syntax and commands:
Ready X=10 Ready PRINT(1/X) 0.1 Ready PRINT LEN("hello") 5
If you wanted to write a program with more than one instruction, there was no need to use a text editor. If you entered a line starting with a number, it would automatically be interpreted as an edition command and added to the current program instead of being executed. You could then use the run command to run the program:
10 X=10 20 PRINT X,EXP(X) run 10 0.1
What is really nice is that as you wrote your program, you could still, at any time, type a “terminal” command to directly check the result, so there was no context switch between your editor and your terminal.
To add an instruction in the middle of the program, you just used a line
number in between, and it would automatically be inserted in the right
position. If you ran out of numbers, the
renum command would recompute all
the line numbers for you. This is why it was important for BASIC to use
numbered lines; it was not just a way to label lines for GOTO commands, but
also the basis of the integrated program editing process.
The list function allowed you to list the code starting from the beginning or from a given line number. This gave the same capability as a paging text editor. There were a few other commands to edit a line, save the program on disk, etc.
15 X=X-1 30 IF X=0 THEN STOP 40 GOTO 15 renum Ready list 10 X=10 20 X=X-1 30 PRINT X,EXP(X) 40 IF X=0 THEN STOP 50 GOTO 20 Ready run 9 8103.08392 8 2980.95798 7 1096.63316 6 403.428794 5 148.413159 4 54.59815 3 20.0855369 2 7.3890561 1 2.71828183 0 1
This system also made debugging a program very easy. During execution, pressing the ESC key twice would stop the program, and all the variables could then be examined or changed, and the program then resumed. This worked well since BASIC does not have stacks or local variables.
To see how it looked like on the actual computer, here is an example video I found online of a typical session on the CPC 464:
The Amstrad CPC 646 would literally take less than a second to boot, this is hard to believe in these days of slow booting computers: https://www.youtube.com/watch?v=wITHivsuRfc&t=554s ↩︎