next up previous contents
Next: 5.3 C and C++ Up: 5 Choosing a Language Previous: 5.1 Scripts   Contents

5.2 BASIC

Historically, BASIC (in its many guises) was arguably the best actual programming language for a beginner to learn. BASIC was initially developed to give non-programmers a language to use to perform simple tasks that were beyond the scope of simple Command Scripting. BASIC has a 'plain language' appearance and structure. For example, the command to print information is "PRINT" (compared to printf(); in C, for example). BASIC has relatively easy to learn string handling capabilities; in fact, a beginner with limited experience could write a rudimentary word processor in an afternoon with BASIC. Further, BASIC remains a very popular language, which means there are many resources available.

In its newest incarnation, BASIC is generally seen as Visual Basic (VB). This language builds on the BASIC infrastructure and adds capabilities to create graphical user interfaces in MS Windows. In VB, it is very easy to create windows for user input and display information. VB has built-in features for rudimentary graphics capabilities and image file manipulations. In addition, many professional programmers create new 'controls' for VB that can be used to further automate the development process.

With VB, the BASIC programming model is altered from the older forms of BASIC. VB is event driven, meaning the program responds to events generated by the user, the OS, other programs, etc. The programmer creates 'event handlers' that instruct the computer in what to do when a given event occurs. Events include, but are not limited to, key presses, mouse clicks, mouse movement, timed events, opening a window, etc.

No matter the programming language, the first program a programmer writes when learning a new language (or environment) is the "Hello World" program. This program simply displays "Hello World" on the computer screen, and it is used to introduce the basic display of information to the user. In Visual Basic, the simple "Hello World" programs takes about 30 seconds to generate, even for someone who has never before written a computer program if a guide is followed (not including the time required to install the compiler). The ease of learning VB and the speed with which very useful programs can be written is perhaps its biggest selling point.

VB, like all variations of BASIC, has its limitations. While very useful, BASIC is not regarded to be fast and encourages sloppy programming. This latter feature contributes to its popularity among beginners, but allows programmers to form bad habits that may cause problems as programs become more complex. Even with these limitations, VB is very often used for simple utilities, Internet applications and even commercial software.


next up previous contents
Next: 5.3 C and C++ Up: 5 Choosing a Language Previous: 5.1 Scripts   Contents
John S. Riley, DSB Scientific Consulting