BASIC is an easy-to-use and easy-to-learn high-level programming language. As a matter of fact, it is even often offered as a high-school course! It is often taught to beginner programmers because while it is easy to use and understand, it is also composed of some of the concepts used by more advanced languages like Pascal and C.
BASIC is an acronym for Beginners' All-purpose Symbolic Instruction Code. It was developed in the early 1960s by John Kemeny and Thomas Kurtz at Dartmouth College. In the years after it's development, BASIC has increasingly become more and more popular, especially with microcomputers. For a while, it was the most popular programming language! However, BASIC is not limited to microcomputers. As a matter of fact, it can also be used with personal computers as well!
BASIC has never really been standardized, and currently it comes in many different versions. For example, there are the versions used by Apple and IBM, as well as versions used by larger computers and businesses.
All of the versions of the BASIC language operate in pretty much the same way.
In a BASIC program, every single line has a number. First, the line with the lowest number is executed, and then the next lowest, and so on. Often, programmers will number their lines in multiples of ten (i.e. 10, 20, 30, etc). This is so additional lines could be added later without causing major problems.
Variables and constants in the BASIC language are both represented by a letter of the alphabet. No special characters, like @, !, and % are allowed. Variable names can be comprised of up to 255 letters or numerical digits. However, if you had two variables who have the same first two letters in their names, then the computer would read them as the same variable. For example, if you had two variables named "DOG" and "DOWN," the computer would think of them as the same variable.
To perform arithmetic operations using BASIC, there are certain symbols:
You might have realized that these symbols are almost exactly the same as the ones found on a calculator!
In addition, there are special symbols called relational operators. These include greater than, less, than, equal, etc:
|<>||Not equal to|
|< =||Less than or equal to|
|> =||Greater than or equal to|
You'll notice that these are almost identical to the ones used in algebra in your math class!
BASIC also includes some logical operators. These are like the gates in Boolean Logic. Below are three of the most common logical operators:
For an expression containing two parts:
a and b à
The expression is true if both a and b are true. Otherwise, it is false
For a expression containing two parts:
a and b à
The expression is true if either a or be is true.
Otherwise, it is false.
This just makes an expression false
In math class, when you are given a long math problem with a combination of parenthesis, addition, subtraction, multiplication, and division, do you just work at it from left to right? Of course not! You use the order of operations-parenthesis first, then exponents, then multiplication and division, etc. Well, there is also an order of operations used in BASIC. It is actually quite similar to that of regular math:
Finally, there are some basic control statements that BASIC uses. Usually, BASIC carries out instructions by doing the lowest line number first, then the second lowest, etc. By using control statements, it is possible to alter the order in which lines are carried out. For example, if you type in "IF THEN ELSE" in conjunction with "GOTO" and a certain line number, the program will go to the specified line number. If you use "IF THEN ELSE" with "GOSUB," the program will go to a certain subroutine (a subroutine is a group of statements that perform certain actions).
As you can see, BASIC is pretty straightforward.
What we have talked about here is only a minute portion of this programming
language though. If you'd like to learn more, I'd suggest going to your library,
or asking your school if they have a course on BASIC!
Continue on to the next programming
1995-2001, ThinkQuest Inc.all rights reserved