Histories – BASIC, or The Language That Could

Back to BASICs? For some people, they never left.

Continuing on the programming theme from the last period, and picking up from the old “Histories” segment which I abruptly stopped writing, I’d like to take the time to educate you about BASIC. Just the name BASIC should bring back fond memories for lots of programmers. BASIC is responsible for a LOT of different applications and games, particularly in the early days of computing, and still gets around today. Let’s take a look at BASIC and see how far its come.

Firstly, what is BASIC? BASIC stands for Beginner’s All-purpose Symbolic Instruction Code, and it was originally designed to give non-science students the ability to write their own programs. This is pretty important because back in the 1960s, when BASIC appeared, computers didn’t have much in the way of software. There was no real operating system like you know today, and there were no libaries of commands or anything like that. Mathmaticians or computer science techies used to write software pretty much in machine code, because without somebody that knew the hardware and knew how to talk to it, the computers were absolutely useless. There were some programming languages out there for some platforms, but they were all designed for specific purposes. Along came BASIC, and it all changed.

BASIC was created in 1963 and it works by passing a series of commands to an interpreter, which can then make the hardware do whatever you ordered it to do. BASIC was designed to be easy to use, be a general purpose lanuage, and be fast, among other things. A lot of BASIC commands are all plain text and easy to understand. PRINT, for example, will print a string of text to the screen. How obvious is that? LINE draws a line. INPUT gets input from the user. END ends the program. Pretty obvious! BASIC had to be very fast because it was designed for “timesharing” systems which were popular back then. Back in the early days of computing, users more often than not had a “dumb terminal”, which was pretty much a screen and a keyboard with a network connection. The terminals connected to the server, which was the actual computer. Yeah, cloud computing goes THAT far back. Timesharing was a system where the computer appeared to multitask by quickly swapping between running applications so that they each get a quick moment to execute. Computers by that time were fast enough that there weren’t any noticable delays so programs could be swapped very quickly, and each user more or less experienced instantaneous (well, almost) results.

BASIC was known as an “unstructured” language. Essentially this means that the program executes its lines of code in order, starting from LINE 10 (the first line) until it ends. There were opportunities to “jump” to other lines in the code, but otherwise it went in one direction and that was it. Loops are possible; a block of lines can execute again and again if required. Structured languages enable blocks of code (called “functions”) which you can reuse or jump to at any time, as well as being able to declare varibles that are valid only for a particular function, among other things. Programming in a structured language can be much more dynamic and can make things a lot easier. For example, if I have a block of code that fetches the time, I could write that block into a function once, and just call that function whenever I need it.

BASIC lacked that to begin with, but it later became more structured (becoming a “procedural” language) which allowed users to go to “subroutines” and return to their original spot in the code. Later variants became “object oriented” which is a whole other concept; in object-oriented programming, programming tasks are broken down into “objects”, where each object has its down data and methods (subroutines, or code blocks) that we call as required.

Getting confused? Yeah, it is confusing for non-programmers. Basically think of it like this: unstructured BASIC more or less just goes through a sequence of lines with little control over how you can change the flow of the program. You can jump to different lines, but that’s about it. Structured BASIC languages let you have greater control over how the program flows, and you can create “subroutines”, which are code blocks that you can keep calling as much as you like, as well as more advanced control over how the program operates. Object-oriented BASIC languages are way beyond the scope of this, so let’s not even bother.

Anyway, let’s move on. Over the years programming languages became less important for end users as operating systems became more common and languges like C took over. Languages like C give far greater control on program flow and can easily let you reuse bits of code as much as you like, but they’re also a lot more complex to learn and use. BASIC looked like it would fade away as the rift between “user” and “programmer” quickly widened. But then Microsoft released a new development tool called Visual Basic, and suddenly BASIC didn’t die.

Visual Basic remains wildly popular today because it incorporates the easy syntax of BASIC with the ability to create Windows applications. Lots of small developers still use it to write their own applications because it’s much easier than C++ or C# to wrap your head around if you’re not used to programming. VB.Net, the object-oriented version of VB, actually loses a fair bit of this ease of use in exchange for flexibility. What used to be MsgBox(“String”) is now Console.Write(“String”) and it goes on and on. Lots of users don’t like this new version of VB, and stick with the old version.

Other BASIC languages are still kicking around for all sorts of purposes. PureBASIC is a VisualBasic-like application designed to create applications and games. It can even interface with OGRE, a 3D graphics engine. Blitz3D and BlitzMax are BASIC languages aimed at game development, as is DarkBASIC. All of these use BASIC commands, but add on new features to make the langugae more structured, or object-oriented. They retain the plain English commands of BASIC, as well as the easy execution method.

What makes BASIC so easy to understand is that you can easily see how the program flows just by looking at it. Languages like C++, despite being very powerful (far more powerful than BASIC), can be a bit daunting to understand. Things don’t always appear to flow in a logical sequence, and things can be referenced from all sorts of different places. BASIC programs, whether they’re structured or OO, will tend to retain that easily understood program flow. That’s what makes them so attractive to users; they’re easy to follow. Also it helps that the most important goal of BASIC (apart from being fast) is that it’s easy to learn. As a result, commands MUST be named logically, hence most of them are in plain English.

BASIC hasn’t died out and shows no signs of dying at all. Visual Basic.Net, despite being a pain to use and taking BASIC a bit too far, remains extremely popular. BASIC isn’t about to die, and if you want to get into programming, but can’t understand C++, then maybe BASIC is still the way to go. Usually we don’t keep relics in computing, but BASIC just won’t die.


Broadcast on this frequency...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s