BASIC was designed to be beginner-friendly, and it shows. Let’s write Hello World.
The Code
Create a file named hello.bas:
| |
That’s it. One line.
Classic Numbered BASIC
In the original BASIC dialects, every line needed a line number:
| |
Understanding the Code
PRINT- Outputs text to the screen"Hello, World!"- A string literal enclosed in quotes- Line numbers - Originally required for program flow and editing
Running with Docker
Using FreeBASIC in Docker:
| |
Running Locally
Install FreeBASIC and run:
| |
Expected Output
Hello, World!
Key Concepts
- BASIC is simple - Designed for beginners, minimal syntax
- PRINT is fundamental - The primary output command
- Modern vs Classic - Modern BASIC doesn’t require line numbers
- Multiple dialects - Many versions exist (GW-BASIC, QBasic, FreeBASIC, etc.)
Historical Context
When BASIC was created in 1964, most programming required punch cards and specialized training. BASIC changed that, making programming accessible to students and hobbyists. This accessibility made it the first language for millions of programmers.
Next Steps
Continue to Variables and Data Types to learn about storing data in BASIC.