The article explains:
- History of the Basic programming language
- Basic introduction
- Syntax and basic commands of the Basic programming language
- Differences of Visual Basic from the classic version of the language
- Development of Visual Basic by Microsoft
- Updated versions of Basic programming language
- Basic programming language critique
- Applications of Basic today
Basic programming language can be described as the opposite of Pascal. Simplified to the max, not for programmers but for the layman - that's how it was conceived when it was created. Of course, that first Basic is no longer used anywhere, but other dialects developed thanks to its principles.
Featured review: Best laptop for engineering student
The best known is Visual Basic. It was developed and began to be used by the IT monster of the day, Microsoft Corporation. Now, the language has excellent prospects and modern versions created to solve various tasks. Read about the history of development, improvement, application of Basic today in our material.
The history of the Basic programming language
The Basic programming language has been developed so that students who are not studied in depth disciplines of higher mathematics could work with it. It is aimed at entry-level users who are not interested in "advanced" programs, but in the possibility to solve various tasks independently, using a PC.
The necessity for such a system was due to the complexity of the previously used languages. To popularise the novelty, the first program, which translated character text written by a programmer into machine codes, was free.
The Basic programming language was developed with 8 basic requirements in mind:
- beginner's orientation;
- universality of use for different tasks;
- possibility of supplementation by tools available to programmers;
- clear and accurate error reporting;
- good speed on small applications;
- the user may not have sufficient understanding of the hardware to create programs;
- effective communication between the user and the OS.
The Basic programming language was based in part on the foundations of systems such as Fortran II and Algol 60. In doing so, it was augmented with features for convenient word processing and matrix arithmetic, as well as for writing time-sharing applications. The system was implemented on the GE-265 platform with support for multiple shells. At the time, Basic was a compiled language, although many experts say otherwise.
After Basic programming language appeared on microcomputers in mid-seventies, it became quite popular. Most of the character systems that existed at the time were too massive, so they required a lot of memory. As the machines at the time were equipped with very slow media (audio cassettes, paper tape) and had no efficient text editor, this compact language came in very handy.
After the release of Altair BASIC in 1975, Microsoft released a series of operating systems that used such a system as the main language. The starting point of a long and successful development of the language was the BASIC-80 dialect for the "operating system" CP/M.
This was followed by the introduction of new compiler programs into the Basic programming language. The Microsoft corporation distributed a number of other Basic versions on a paid basis. These were intended for MS-DOS/PC-DOS, including BASICA, GW-BASIC and QuickBASIC (QBASIC). In 1985, Borland developed Turbo Basics 1.0, versions of which were then distributed by another firm as PowerBASIC.
Featured review: Best laptop for Machine Learning
Various Basic extensions were installed on personal PCs, which most often included tools for working with sound, graphics, executing system commands to work with DOS drives, and for structural programming. In a number of third-party languages, Basic syntax has acted as the foundation for building completely different systems. An example of this is the GRASS programming language, which is used to write 2D vector graphics scripts.
Since the early 90s, computer hardware has become considerably more complex. At the same time, the capabilities of the PC (e.g. the graphical interface) have also expanded considerably. This development has revealed a significant disadvantage in the use of programming language BASIC. Its position has shaken, but many users still widely used this symbolic system.
Microsoft Visual Basic is a programming language which appeared in 1991 and gave a new development to Basic. It resembles its ancestor only in its syntax, which is more modern. Visual Basic gradually became one of the most popular Windows languages. Somewhat later, another variant of Visual Basic, called WordBasic, appeared. MS Word ran on this system until Word 97 was distributed.
In 1993, Visual Basic for Applications (VBA) was used for the office application Excel 5.0. Two years later it became part of Access 95 as well as a number of tools within Microsoft Office. Since 1997, the Basic language interpreter - VBScrip is included in Internet Explorer 3.0 and later versions. In addition, a Basic element that performs line-by-line analysis, processing, and execution of program code has been included in the full Open Office suite.
Now under the Basic name there is a whole set of programming languages which differ in syntax, paradigms, and time of creation. Sometimes these systems are not even compatible with each other. The original versions of the Basic programming languages did not support paradigms in which programs are represented in the form of a hierarchical block structure.
Featured article: learn everything about working with files in Python
he support for structured and procedural writing of software products has now become commonplace. Basics has not been spared from this process, and versions supporting such paradigms have been developed based on it. Many compilers, including Visual Basic and VB.NET are oriented towards object-oriented and event-driven programming.
General characteristics of Basic language
In brief, the Basic programming language is an algorithmic system whose job is to keep the user communicating with the computer. It is aimed at solving problems with small initial data of computational and noncomputational character.
Basic is a low-level programming language whose name is made up from the first letters of the English phrase "Beginner's All-purpose Symbolic Instruction Code". However, no unified standard is defined for the Basic family. Different versions of this system have very significant differences.
Basic programming language includes a set of operators used as a means to describe the functions of an algorithm and also means for communicating with a computer (commands) that have the form of direct instructions for immediate execution. Basic mode of this symbol system is a program mode (program written in Basic is introduced and executed by a computer in its entirety).
Basic is a programming language which examples include strings with possibility to assign numbers to them. Thus one line may contain one or even a number of operators separated by a colon ":". String numbering starts at 10. The numbering step is 10. String numbering is used in operators, which transfer control. At the same time, they also serve as the start of the line.
This is an example of an application in the Basic programming language:
S=0 I=1 10 S=S+I I = I + 1 IF I<=10 TN GOTO 10 PRINT S END
This notation allows the application to add the first 10 natural numbers. Here, the essence of each operator and the order in which they are executed is fairly clear. The result of program execution is the calculation of the value S, which the PRINT operator outputs to the monitor.
Read also: FastAPI framework
Syntax and basic commands of the Basic programming language
The easiest entry in Basic is
PRINT "Hello, WORLD!"
Basic is a programming language which doesn't care what register is pointed out. In other words, it understands the words PRINT and print equally. Note that this applies not only to keywords, but also to variable names. However, there are still some variations of this language which are case sensitive. An example is the Liberty BASIC system.
Variable names can consist of letters and numbers, but the first character must be a letter. In order to assign a variable to a string type, the variable name must be followed by a $.
X = 100 'Numeric variable X$ = "Hello" 'String variable
Expressions here are no different from those found in other procedural character systems. It's worth noting that early versions of Basic had very few of these. There were no more than 20 keywords in the first versions of the language, which is what made Basic so attractive.
Read also: Django framework
You don't have to specify a simple variable. You just write its name anywhere in the program. But arrays in this language have to be declared.
We will now present a list of basic constructs, implemented in almost all interpretations of the Basic system since the seventies. Many of them are also supported by modern versions of Basic:
- LIST - representation of program text on the screen with correct display of a sequence of lines.
- RUN - starts the program from the first lower numbered line operator.
- REM - comment, which is the text behind the keyword. It lasts until the end of the line. Most interpreters provide support for a single quote ' as a comment start character. Some of these programs allow the REM record to be used if it is placed directly at the beginning of a line.
- INPUT - provides a screen prompt, after which the user is expected to enter a value and press ENTER.
- PRINT - facilitates the display of text and variable values on the screen.
- CLS - clears the monitor.
- DIM - indicates a description of an array. Arrays differ from standard variables in that they need to be declared beforehand.
- GOTO Label - unconditional jump to Label.
- IF … THEN … - Standard branch command. A logical condition is written after IF, and after THEN - the command, which is executed if this condition is true.
- END - End of program operation. The system goes to the interpreter and the operator prompt is displayed on the monitor.
- SAVE - An interactive mode statement that saves the current application to a file in external memory.
- LOAD - An interactive mode statement that loads a program into memory from an external memory file. This usually removes the previously loaded application and data from the internal memory.
Here is an example of a program entry in Basic:
10 CLS 'Clear screen 20 PRINT 'Hello, WORLD!!!' 30 X = 100 'Assign 100 to the X variable 40 INPUT "Enter a number : "; Y 50 PRINT Y; " * "; X; " = "; X * Y 60 END
Differences between Visual Basic and the classical version of the language
The appearance of the most popular variant of the Basic programming language was caused by Microsoft's development of the QBasic interpreter. For a long time this code interpreter was included in early versions of Windows as well as MSDOS as a free application. It contained sufficiently powerful sound and graphics tools to enable the development of computer games.
The later versions of BASIC (programming language Turbo Basic and Visual Basic) have changed considerably from the early versions.
These interpretations can even be considered as entirely new systems. These versions resemble Fortran and Pascal more in their characteristics than Basic. In the nineties the following changes took place in the programming language in question:
- Developers moved away from presenting software products as a set of numbered lines. These numbers have now become standard optional labels that do not affect the order in which commands are executed. While in previous versions, line number 11 was always executed before line 14, after these changes, the order of execution is determined by the position of the line in the initial code. The labels no longer have to be numbers.
- Named subprograms appeared in the system. The order in which they are called has become standard. Subprograms are called by their name. Its parameters are also specified.
- Structured control modules have been implemented. It is no longer necessary to specify a GOTO command and line labels to create standard branches and loops.
- The nomenclature of data types has been increased. The programmers have got the possibility to describe the standard types of variables explicitly.
- The obligatory use of suffixes indicating the type of a variable in its name has been abolished (but using them is not an error either).
- Modularity support has been introduced. Users can, without "tricks" (like dynamic loading of modules using explicit system calls), divide the program into several source modules.
- Newer versions include tools to handle sound and graphics cards.
- Visual Basic, which has been used to enhance Windows applications with a graphical user interface, is integrated with the appropriate "designer", so there is much less time required to write simple Windows applications.
- Developers have created versions that can run on multiple hardware platforms or operating systems.
Almost all significant shortcomings of the first versions have been eliminated. The process of writing programs on modern versions of Basic is almost no different from working with other systems (for example, Delphi). But it should be noted that this "refinement" has led to the fact that Basic has become more voluminous and complex. Learning a modern Basic programming language is already a more time-consuming process.
Development of Visual Basic at Microsoft
The system developed by the creators of Visual Basic made it possible to move away from the complex internal structure and start building programs "particle by particle". The majority of structural units of Windows interface such as: menus, windows, lists, buttons and input fields have been included using elementary drag&drop operations. Already from the first minutes of acquaintance with the language, Visual Basic specialists set about creating the first program on this system!
Moreover, programmers had the ability to create new objects - "cubes" which could also be used in programs on a par with standard ones. And although many quietly scoffed at Microsoft's attempts to make a simple and straightforward Windows program development tool, Visual Basic began its triumphant march around the world, and nothing could stop the process.
The year 1994 marked the fall of the last barriers to further development of the Basic language. This was preceded by the release of Visual Basic for Applications. As VBA became part of Microsoft Office, the Basic programming language became a major standard for Windows. The system played an important role in Microsoft's development. In fact, in the not too distant past, when Basic was created for the Altair 8800 computer, Bill Gates and Paul Allen's ideas on programming were implemented.
In 1989, these events marked the beginning of a division between the various branches of the mainstream development of development environments in all sorts of programming languages. At the same time, Microsoft retained QuickBasic as an integrated programming environment based on Basic.
However, Borland got to work on the Basic Pascal programming language, which was abandoned by Microsoft. At this time, Borland were forced to suspend their work on Basic, and later Pascal became the Delphi language.
Visual Basic was not taken seriously at first, but in a short time it surpassed all expectations and took over the programming world. It became popular because of its simplicity and productivity. Programs developed on the basis of Visual Basic differ with high speed what cannot be said about their analogues in C/C++. But at the same time development of applications in Basic doesn't take much time. New versions of this system are excellent for solving various business tasks.
Visual Basic has provided Windows programmers with forms saving developers' efforts with its abstraction. Visual Basic IDE has made it possible to create graphical windows by dragging controls. They could be buttons or lists integrated from the toolbar into the form. Once an attractive visual shell image was formed, it was time to work on the code part and write event interpreters for each individual control.
This way the Visual Basic application was made up of several modules which communicated with each other, not excluding their appeal to the database for the required information. As a result, the form was a window offering a transition to advanced techniques in the most comfortable way.
Visual Basic developers managed to reduce the number of flaws by removing some hidden C/C++ syntax elements. Except for some special situations, expressions had the limits of one code line, while variables were declared and initialized in separate places in the program. Visual Basic's grammar mandated the use of assignment and comparison operators so that their intentions were strictly defined when a single character was specified.
Read also: Haskell programming language
Since the earliest versions of Microsoft Basic it has been assumed that the primary meaningful indicator is the absence of pointers. This was Bill Gates' condition. However, the function of pointers is quite useful, as they provide direct access to memory at each address. When they are used, there may be flaws due to the negligence of a technician. The grammatical accessibility of Basic has its origins in the creation of a language for learning: "Beginner's All-purpose Symbolic Instructional Code", meaning "All-purpose Symbolic Instructional Code for Beginners".
The powerful Visual Basic Version 6 language is oriented towards the development of distributed applications using components such as: COM and Microsoft Transaction Server. The three-step approach for client-server architecture was set by Microsoft. In it, 'thin' user interfaces communicated with remote Visual Basic components that could retrieve data from a database or another machine.
With VBScript and VBA (VB for Applications), it's possible to script for web browsers. In addition, Microsoft Office-based application automation is also available. At the same time. Version 6 of Visual Basic can be used to develop Active-X controls which interact in conjunction with Internet Explorer. However, this does not happen often because of the requirement that the client machine has a VB runtime DLL installed.
Visual Basic programs from version 5 onwards compiled to machine code, but they were based on the use of a DLL that provided in all directions of function use and carried out Visual Basic's object capabilities.
It's important to note that the VB compiler uses a multi-pass mode, and eventually relies on an algorithm that translates text to the machine code set used by Microsoft C++. Inheritance from .NET can be traced in the Visual Basic characteristic, which is the use of temporary runtime library and C++ composite interface.
Updated versions of the Basic programming language
Today, the old C64 is no longer relevant for writing a program. This statement does not apply to enthusiastic fans of vintage systems. Nevertheless, it should be noted that the end of Basic's history was not marked by the obsolescence of the Commodore and Atari. Later, Microsoft developed upgraded versions of Visual Basic, Visual Basic for Applications (VBA) and VB.NET. The most recent on the list allows you to write VB code for the .NET platform.
In addition, 2008 marked the release of the Small Basic programming language. It is primarily aimed at beginners.
Among the various graphical and programmable calculators from Yi, HP, Casio and other developers, BASIC dialects can also be found. However, most of them are not directly compatible with the initial standard of this language (ISO/IEC 10279:1991). At its formative stage, it was changed from mandatory line numbering to the use of tagged code. At the same time, the latest programming techniques became available. This is the characteristic of the upgraded version of QuickBasic in 1985, which is still useful today.
See also: Why Minecraft is polular?
One implementation of the system is the commercial PureBasic by Fantaisie Software, which provides IDEs and compilers that are designed for a group of target platforms. At the same time, TrueBasic is the latest toolkit which includes an IDE, with syntax close to FORTRAN. At the same time, it was compiled by the developers of the language, Darthmouth BASIC.
Speaking of open interpreters and compilers for BASIC today, Chipmunk Basic is one of them. It belongs to the Apple Macintosh period as well as GW-BASIC from Microsoft whose code was discovered just recently. In addition, this language is surrounded by a healthy OSS ecosystem.
If none of this concerns you, there is also Tiny BASIC which uses a Backus-Naur-like syntax. It was mentioned in the 1976 issue of Dr. Dobb's journal of computers. Not so long ago Tom Nardi, who was one of the authors of Hackaday, talked about his experience of porting the old QuickBasic project from the 90's to the modern format using QB64.
A critique of the Basic programming language
The period from 1970 to 1980 is considered the best period in the history of Basic's existence, but despite this, the system was heavily criticised, as were many other programming languages of the time.
Basic certainly had a significant number of flaws. But this is what the developers intended, creating a simple and understandable language with its own shortcomings.
See also our Tips to master Git
Most often professional programmers criticized Basic as a programming language for beginners for its excessive simplicity and lack of structure. This is the point that affects the "right" approach to programming, which is forgotten by programmers without much experience in creating programs in the shortest time. This situation is possible when developing simple programs, but when it comes to writing serious projects, it will not lead to positive results.
Using Basic as a basis for learning was unacceptable for beginners, according to most professionals. Edsger Dijkstra, one of the world's leading programmers, said that students who had previously been taught Basic were finding it very difficult to learn decent programming. In his opinion, as potential programmers they are "mentally traumatised" with no chance of recovery.
Despite Dijkstra's authority, many experts disagreed with him. The shortcomings that were noted in Basics were in fact also its strengths. The language was not intended to be used by programmers engaged in professional writing of complex and large programs, or for their initial training. It was in the course of such operations that the disadvantages of BASIC were highlighted.
Read also: how GIL works
Its main function was to allow students and novice programmers to write simple programs for their own purposes without consulting specialists. BASIC copes successfully with this function.
As for the modern dialects and newer implementations of Basics, they are very different from the original language form, so all the aforementioned cannot be attributed to them. The variations of today's Basics can be described as very structured languages which are comparable to languages such as: C, Pascal, etc.
Both modern Basic and its elementary implementations in the form of QBasic are suitable for mastering programming. In this case, there will be no special difficulties in the further learning of other languages as well. Most likely, the above disadvantages are a problem relative to the 1960s. However, this is not the case today. In addition, retraining now is not necessary, because you can develop your own interesting programs, for example, in Visual Basic.
Applications of Basic programming language today
It is not a secret that BASIC is just gaining popularity for applications in commercial forms, in many open source projects and in working communities where old computers are used. However, one can argue with this too. It could just as well be used as a language for learning to program. In addition, BASIC's low system requirements are ideal for developing embedded applications.
Read also: Working with strings in Python
Design variants similar to UBASIC PLUS are also available. This system is oriented on the STM32F0. Software requirements in this case are only 8Kb of RAM and 64Kb of flash memory. The ARM and PIC32 are examples of this.
BASIC was born at a time when computers didn't yet have as much memory as today's $5 microcontrollers. This led to a low demand on the system's machine resources.
Such languages are effective in situations where not compiled binaries but scripted interpreted forms can be used. In this case there is no need to buy a microcontroller with extensive RAM and flash memory.
The programming languages Basic and Visual Basic have been substantially modernized since their inception. Some of the changes are irreversible, so the characteristic simplicity is largely a thing of the past. We are now dealing with a standard high-level object-oriented language, which is recommended for programmers to learn.
Read also: Python vs C++ speed comparison