Visual Basic

last modified July 6, 2020

In this part of the Visual Basic tutorial, we will introduce the Visual Basic programming language.


The goal of this tutorial is to get you started with the Visual Basic programming language. The tutorial covers the core of the Visual Basic language. Variables, arrays, control structures and other core features. It does not cover graphical interface development.

Visual Basic

The Visual Basic programming language is a high-level programming language for the .NET Framework. It is a very popular language. Currently, it is one of the top 10 popular languages in the world. It was created for the Windows platform. The Mono project has created a clone for the Linux and Mac platforms. The Visual Basic was created to be easy to learn. It was derived from the family of BASIC languages. It is an object oriented, compiled language. The source code is compiled into executable (.exe) files, which are executed by the .Net platform. Visual Basic underwent many changes since its initial release. It was heavily criticised for its poor design. Many of the shortcomings were fixed. Some of the not so good relics still remain in the syntax. Once considered a simpler cousin to C#, over the years it became a full featured advanced programming language. Its popularity rose and declined.

Programming languages

There are currently several widely used programming languages. The following list is based on the TIOBE Programming Community Index. The numbers are from August 2010. Note that these figures are only illustrative. No one knows the exact numbers.

Position Language Ratings
5Visual Basic5.4%
9Objective C3.2%

Java is the most widely used programming language. Java excels in creating portable mobile applications, programming various appliances and in creating enterprise applications. Every fourth application is programmed in C/C++. They are mainly used for creating operating systems and various desktop applications. C/C++ are the most widely used system programming languages. Most famous desktop applications were created in C++. May it be MS Office, Macromedia Flash, Adobe Photoshop or 3D Max. These two languages also dominate the game programming business.

PHP dominates over the Web. While Java is used mainly by large organisations, PHP is used by smaller companies and individuals.

Visual Basic represents the popularity of rapid application development and the dominance of Microsoft.

The C# was planned to be the next big language. It should compete mainly with Java and C/C++ languages.

Python and PERL are popular scripting languages and close competitors.

The popularity of the Objective C stems from Mac and their innovative appliances.

Deplhi is a popular RAD development tool.


Examples in this tutorial were tested on Linux and Windows XP. On Linux I have used the Mono Visual Basic compiler. On Windows, Visual Basic 2008 Express Edition was used.

On Linux, we need to have installed the Mono Visual Basic compiler. It is called vbnc.

$ vbnc simple.vb 
$ ./simple.exe 
This is Visual Basic

We compile and run a simple Visual Basic program on Linux.

Under Windows, create a new project. Select File/New Project or click Ctrl+N and select Console application.

Console application
Figure: Console application

To run an example, click Ctrl+F5.


The following three sources were used to create this tutorial:

In this part of the Visual Basic tutorial, we have introduced the Visual Basic language.