History of Basic

When timesharing computers first appeared there was a need for a language that could be used interactively by users and could be learned quickly.

BASIC (Beginner's All Purpose Symbolic Instruction Code) was written in 1963, at Dartmouth College, by John Kemeny and Tom Kurtzas.

Basic was developed to be an interpreted language. Up until that time users had to submit their programs as batch jobs on a mainframe computer, perhaps on punched cards, the punched cards had to be loaded, compiled, linked and run, the user would then get a printout with the results, perhaps several hours later.

With timesharing computers, users could type in their Basic program themselves, then type run and see the results instantly. Later when personal computers were invented Basic was a good way to allow people to start programming quickly on their own computer.

However Basic does have some bad points, it is not very scalable, it can encourage bad programming practices and interpreted programs can run slower. There are modern dialects of Basic which get round these problems by making the language more like a modern structured language but then you loose the simplicity.

If you are starting to learn programming from scratch it is far better to start with a modern language such as Java.

example of the original basic dialect:

10 READ A, B, C
20 LET R1 = (-B+(B^2 - 4*A*C)^0.5)/(2*A)
30 LET R2 = (-B-(B^2 - 4*A*C)^0.5)/(2*A)
50 DATA 2, -1, -1
60 END

When the user types a line starting with a number, this is stored, when RUN is typed the stored code is then interpreted.

Dartmouth BASIC Language Elements


DIM Declare upper bounds of array dimensions 100 DIM A(20,20), B$(30)
DEF Declare function 100 DEF FNA(N)=N + SQR(N)


REM Insert comment with source program listing 100 REM PROCESS INPUT


LET Evaluate expression and assign value to variable 100 LET A=B^2 - C

Control statements

GOTO Unconditional branch 100 GOTO 300
IF ... THEN Conditional branch 100 IF A>B THEN 300
ON Indexed branch 100 ON X-Y GOTO 300,400,500
FOR .. STEP Beginning of loop 100 FOR N=1 TO 5 STEP 2
NEXT End of loop 300 NEXT N
GOSUB Subroutine call 100 GOSUB 300
RETURN End of subroutine 600 RETURN
STOP Terminate program 600 STOP
END Halts execution 9999 END

Input/output statements

READ Assign values from data queue to specified variables 100 READ A$,X
DATA Establish values in data queue 600 DATA FRED,10
RESTORE Return pointer to start of data queue 600 RESTORE
INPUT Assign values input from console to specified variables 100 INPUT A$,X
PRINT Print specified values 100 PRINT "RESULT+",A$,X

Matrix operations

MAT READ Input values of whole matrix from data queue 100 MAT READ A,B
MAT PRINT Print whole matrix 100 MAT PRINT A
MAT add/subtract Add or subtract matrices 100 MAT A = B + C - D
MAT multiply Multiply matrix by matrix 100 MAT A = B * C
MAT multiply by constant Multiply matrix by constant 100 MAT A = (2) * B
MAT INV Invert matrix 100 MAT A=INV(B)
MAT TRN Transpose matrix 100 MAT A=TRN(B)
MAT ZER matrix with all zeros 100 MAT A=ZER
MAT CON matrix with all ones 100 MAT A=CON
MAT IDN identity matrix 100 MAT A=IDN


BYE exit from BASIC system BYE
DELETE delete lines from work file DELETE 100-200
LIST complete or partial program listing LIST 100-200
NEW setup scratch file as new work file NEW fred
OLD setup saved file as new work file OLD fred
RENAME rename work file RENAME fred
RUN cause program in work file to be executed RUN
SAVE copy work file to disc SAVE
UNSAVE delete saved program UNSAVE fred

Visual Basic

Microsoft have modified the language to include Object Oriented capabilities (but taken out the built in matrix types!)

Tutorial - Using Visual Basic to write a 2D game

metadata block
see also:

Tutorial - Using Visual Basic to write a 2D game

Correspondence about this page

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2023 Martin John Baker - All rights reserved - privacy policy.