Introduction to BASIC

BASIC stands for Beginner's All-purpose Symbolic Instruction Code.

1.1 What is BASIC?

BASIC stands for Beginner's All-purpose Symbolic Instruction Code. It was designed in 1964 at Dartmouth College so that students in *any* field — not just mathematicians and engineers — could write programs. Its design goals were:

Easy for beginners, but powerful enough for real work.

Interactive: type a line, run it, get an answer immediately.

Clear, English-like keywords (PRINT, INPUT, IF, THEN, FOR, NEXT).

Error messages that make sense to non-experts.

Free to use and hiding details of the hardware and operating system.

1.2 One name, many languages

"BASIC" is not a single language but a family of hundreds of dialects that share keywords and spirit:

Classic BASIC — line numbers, GOTO, GOSUB, interpreters in ROM (Commodore 64, Apple II, ZX Spectrum, GW-BASIC).

Structured BASIC — no line numbers, SUB/FUNCTION, block IF, DO/LOOP (QuickBASIC, QBasic, BBC BASIC, True BASIC, QB64, FreeBASIC).

Visual / event-driven BASIC — forms, controls, events (Visual Basic 1–6, VBA, Xojo, Gambas, B4X).

Object-oriented .NET BASIC — Visual Basic .NET, a full-featured language on the .NET runtime.

Educational BASIC — Microsoft Small Basic, SmallBASIC.

1.3 Why learn BASIC today?

Gentle on-ramp: you can write a working program in one line and see graphics in five.

Instant feedback: QB64-PE gives you a full IDE, compiler, graphics, and sound in a single download.

Real-world use: VBA still automates millions of Excel workbooks; VB.NET powers line-of-business applications; FreeBASIC and PureBasic build native tools and games.

Computing history: reading and porting classic BASIC programs (from books such as *BASIC Computer Games*) teaches how software evolved.

Transferable concepts: variables, loops, procedures, arrays, records, files, and event loops carry over to every language.

1.4 The dialects used in this course

Role in this course QB64 Phoenix Edition (QB64-PE) Main teaching dialect; all main examples run here Windows, Linux, macOS

Classic line-numbered BASIC (GW-BASIC/Microsoft BASIC) Historical notes and porting

Emulators, PC-BASIC, QB64 (accepts line numbers) Side notes; full chapter on OOP, pointers, threads Windows, Linux, DOS Visual Basic.NET

Side notes; full chapter on classes, LINQ, async Windows, Linux, macOS (.NET) Full chapter on Office automation Microsoft Small Basic Full chapter for absolute beginners Windows, browser Side notes look like this:

Classic BASIC: how the same idea looked with line numbers. FreeBASIC: what changes in fbc with the default -lang fb. VB.NET: the equivalent in Visual Basic .NET.

1.5 How BASIC programs run

Interpreters (GW-BASIC, Commodore BASIC, QBasic) read and execute source line by line. Easy to experiment with, slower to run.

Compilers (QuickBASIC, QB64-PE, FreeBASIC, PureBasic) translate the whole program to machine code. QB64-PE translates BASIC to C++ and compiles it with a bundled C++ compiler, producing a native executable.

Virtual machines (VB.NET compiles to .NET IL; Small Basic too) run on a managed runtime with garbage collection.