BASIC Programming Language — Comprehensive Notes
BASIC
Beginners' All-purpose Symbolic Instruction Code
A Comprehensive Reference Guide
Overview
BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of high-level programming
languages designed in 1964 by John G. Kemeny and Thomas E. Kurtz at Dartmouth College. It
was created with a single goal: make programming accessible to non-science students.
History
Year Event
1964 Dartmouth BASIC created; first ran on a GE-225 mainframe
1975 Microsoft's Gates & Allen wrote Altair BASIC for the MITS Altair 8800
1977–80s BASIC became standard on home computers: Apple II, Commodore 64, TRS-80, Atari
1985 QuickBASIC released by Microsoft, adding structured programming
1991 Visual Basic introduced, bringing BASIC to GUI/Windows development
Today Descendants include VBA, [Link], and various embedded dialects
Key Characteristics
• Interpreted (originally) — code runs line by line without a separate compile step
• Line-numbered — classic BASIC required each line to have a number (10, 20, 30…)
• Interactive — designed for direct, conversational use at a terminal
• Forgiving syntax — minimal boilerplate, easy to learn
Core Syntax & Concepts
Variables & Data Types
LET X = 10 ' Integer
LET NAME$ = "Alice" ' String ($ suffix)
LET PI = 3.14159 ' Float
Page 1
BASIC Programming Language — Comprehensive Notes
Input & Output
PRINT "Hello, World!"
INPUT "Enter your name: ", NAME$
PRINT "Hello, "; NAME$
Arithmetic Operators
Operator Meaning
+ Addition
- Subtraction
* Multiplication
/ Division
^ Exponentiation
MOD Modulus
Control Flow
' IF-THEN-ELSE
IF X > 10 THEN
PRINT "Big"
ELSE
PRINT "Small"
END IF
' FOR loop
FOR I = 1 TO 10
PRINT I
NEXT I
' WHILE loop
WHILE X > 0
X = X - 1
WEND
' GOTO (classic BASIC)
10 PRINT "Hello"
20 GOTO 10
Subroutines & Functions
' GOSUB / RETURN (classic)
GOSUB 100
END
100 PRINT "Subroutine"
RETURN
' Modern SUB / FUNCTION
SUB Greet(Name$)
PRINT "Hello, "; Name$
END SUB
Page 2
BASIC Programming Language — Comprehensive Notes
FUNCTION Square(N)
Square = N * N
END FUNCTION
Arrays
DIM Scores(10) ' 1D array of 10 elements
DIM Grid(5, 5) ' 2D array
Scores(1) = 95
Common Built-in Functions
Function Description
ABS(x) Absolute value
SQR(x) Square root
INT(x) Integer part (floor)
RND Random number (0–1)
LEN(s$) Length of string
MID$(s$, p, n) Substring from position p, length n
LEFT$(s$, n) Left n characters
RIGHT$(s$, n) Right n characters
STR$(x) Number to string
VAL(s$) String to number
Code Examples
Classic Hello World
10 PRINT "Hello, World!"
20 END
Number Guessing Game
10 REM Simple number guessing game
20 LET SECRET = INT(RND * 100) + 1
30 PRINT "Guess a number between 1 and 100"
40 INPUT "Your guess: ", GUESS
50 IF GUESS < SECRET THEN PRINT "Too low!" : GOTO 40
60 IF GUESS > SECRET THEN PRINT "Too high!" : GOTO 40
70 PRINT "Correct! You got it!"
80 END
Page 3
BASIC Programming Language — Comprehensive Notes
Dialects & Variants
Dialect Platform / Era
Dartmouth BASIC Original, 1964
Applesoft BASIC Apple II
Commodore BASIC C64, VIC-20
GW-BASIC MS-DOS
QBasic / QuickBASIC MS-DOS, structured
Visual Basic (VB6) Windows GUI
VBA Microsoft Office (still widely used)
[Link] .NET Framework
FreeBASIC Modern, open-source
BBC BASIC BBC Micro / modern revival
Strengths & Limitations
Strengths
• Extremely beginner-friendly
• Fast to prototype ideas
• Widely available on legacy and embedded systems
• VBA still heavily used in enterprise (Excel/Access)
Limitations
• GOTO-heavy code leads to 'spaghetti code'
• Weak typing can cause subtle bugs
• Not suited for large, complex software
• Largely replaced by Python for beginner education
Legacy & Influence
BASIC democratized computing in the 1970s–80s, giving a generation their first programming
experience. Its influence lives on in VBA (still ubiquitous in business), [Link] (enterprise .NET
apps), and its philosophy of approachability — which deeply influenced languages like Python.
Page 4