If you’re interested in learning to program, you may wonder, “Why not jump right in and start learning C++?” There’s nothing wrong with learning C++ right away, but the cryptic nature of C++ can be as confusing to a novice programmer as reading and writing Chinese or Arabic can be to a native English speaker. If you try to learn C++ right away, the technical details of learning the language can often interfere with understanding the general principles of programming.
That’s why this site introduces programming concepts, using BASIC for a couple of reasons:
-
BASIC was specially designed to teach beginners how to program, so it’s one of the easiest languages for anyone to learn. Most BASIC commands are similar to English words, which makes learning easier in much the same way that native English speakers find that learning to read and write French or Spanish is easier than learning to read and write Arabic and Chinese.
-
BASIC is powerful, so after you learn BASIC, you can apply your BASIC programming skills right away to create commercial-quality programs.
Liberty BASIC uses a simple BASIC dialect so you can start learning programming right away. After you understand how programming in the BASIC language works, you can graduate to REALbasic, which offers a more advanced BASIC dialect that includes object-oriented programming features, commonly found in more powerful programming languages like C++.
Liberty BASIC is a shareware program, so if you find it useful, consider paying for it. REALbasic is a trial version that you can use for a limited time. When this trial period is over, you have to buy a copy of REALbasic if you want to continue using it.
Getting to know Liberty BASIC
Liberty BASIC closely follows the goals of the original BASIC programming language, which emphasizes simplicity. The entire Liberty BASIC program to display It works! on-screen consists of a single line:
PRINT “It works!”
In the early days of computers, programming was slow. First you had to write your commands and store them in a file. Then you had to compile them into a program. Finally, you had to run your program to test whether it worked. If it didn’t work, you had to edit your commands, compile them again, and run the new program once more.
The problem was that most compilers were slow. For a large program, it was customary to compile a program overnight and then return the next morning to see whether it worked. Obviously, such a slow process made programming tedious and frustrating. So the whole idea behind BASIC was to make programming fun by giving you instant feedback on whether your program would work.
Instead of using a compiler, the first BASIC language used an interpreter so programmers could type a BASIC command into the computer and immediately see whether it would work. Not only did BASIC give instant feedback so people could program faster, but it also used more English-like words for its commands to make programming easier, especially for beginners. In fact, BASIC is actually an acronym that stands for Beginner’s All-purpose Symbolic Instruction Code.
Although BASIC compilers are now just as fast as BASIC interpreters, the central goal of BASIC remains the same: Make programming easy for beginners while still being powerful enough to create commercial-quality programs.
Remember In BASIC, you can type commands in all uppercase (PRINT), lowercase (print), or a combination of the two (Print).
Almost anyone can figure out how the previous Liberty BASIC program works without knowing anything about programming. Novices often start learning to program in BASIC because it makes programming easy and simple. When you understand the fundamental principles of programming, you can always graduate to a more powerful (and complicated) language like C++, or you can just continue using BASIC.
Getting to know REALbasic
REALbasic is an object-oriented version of BASIC that includes rapid application development (RAD) features that let you design a user interface by drawing buttons, menus, and other types of controls on a window.
To write a REALbasic program, you typically design the user interface and then write BASIC code to make user interface actually respond to the user and do something useful. REALbasic programs consist of two parts: a user interface and the BASIC code that makes the user interface work. So to display It works! on-screen, you could create a user interface with a single button on it.
When you run this program, it displays the user interface and waits until the user clicks the button. The moment the user clicks the button, the following BASIC code runs:
Sub Action() ?1
MsgBox “It works!” ?2
End Sub ?3
Although still fairly easy to understand, the REALbasic program consists of three lines that work as follows:
-
?1 The Sub keyword is short for subprogram and identifies the BASIC code as a self-contained chunk of code that’s part of a larger program (hence the prefix sub- in subprogram). The Action keyword tells the computer to run the commands in this subprogram when the user clicks the button displayed on the user interface .
-
?2 The MsgBox command tells the computer to display a small window, called a message box, on-screen with the words It works! shown inside.
-
?3 The End Sub keywords define the end of the subprogram.
