Write your first program

Way back in the the late ’70s and early ’80s, when PCs were becoming more popular as consumer devices, the programming language of the time was BASIC, which was itself an acronym for ‘Beginner’s All-Purpose Symbolic Instruction Code.’ Ironic, then, that the link is a TIME article lauding fifty years of the language. It’s a cumbersome name, but it was the layman’s first exposure to programming and to what it could do, and it was easier to understand than the Assembly language that was used by serious programmers like those in the picture at the link, and it’s even more understandable than the languages we have today such as C# (pronounced “C sharp”) and Java. If you’d like to experiment with C#, Microsoft makes the IDE, or Integrated Development Environment, free to download and there are really great tutorials at the C# link as well as at learnvisualstudio.net.

We now have Visual Basic, but original BASIC used line numbers in front of every line, usually incremented by 10, so  program might look like:

10 PRINT “Hello World!”;
20 GOTO 10

This program would print the phrase ‘Hello World’ over and over until you stopped it. If you needed to add a line between the two that comprise this program, you could preface it with any number between 11 and 19, but if you needed more than that you were in trouble.

BASIC programs could be very complex, as you can see here. In fact, one of the earliest graphics-capable adventure games ever created for the computer, back in 1979 and on an Apple IIe – while not looking like much – was created entirely in BASIC; it’s still considered a programming triumph. Back then we’d never seen anything like it, and it shows the power of the language in capable hands. You can see it in all its glory below. That’s a six-hour video, by the way. We don’t screw around here.

For those of you whose experience with PCs goes WAY back, you might remember Gorillas, a well-known BASIC game where gorillas on buildings throw bananas at each other. This was included with MS-DOS 5 all the way back in 1991.

Gorillas. Remember this?

Gorillas. Remember this?

If you are interested in original line-numbered BASIC, if you would like to see what programming was like during that simpler time when all we had was the command line, you can experiment with BASIC programming yourself at the Quite Basic website. I’ll even give you a program to start with.

When you first visit the site, you’ll see a program already typed in, and if you’d like to see what it does you can hit the ‘play’ button right above the code window and it will draw some circles. Or, you can delete all the green code in the text window and type this instead (you have to type it yourself; copying and pasting adds hidden characters that cause an error – same for the “Hello World” program above):

10 INPUT “What is your name?”; n
20 PRINT “Well hello there, “; n; “!”

If you type this in the window, then hit that same play button right above the window, you will be prompted for your name, and when you type it in it will respond with “Well hello there [you]!”.

You can experiment extensively with it, the site is rich with information and examples, you can even create and save projects if you’re so inclined. The key commands in Visual Basic that we use today, and even in languages like C# and Java are the same, such as GOTO, DO WHILE, and IF THEN as examples, and it’s not too hard to learn the basics.

Get it?