Skip to content

1. Introduction

The PDF of this document is available |HERE|.

VB.NET is a relatively new language. It has been available in beta versions since 2000 and was officially released in February 2002 alongside Microsoft’s .NET platform, to which it is tied. VB.NET can only run in this runtime environment, which is currently available only on Windows NT, 2000, and XP machines.

With the .NET platform, three new languages have emerged: C#, VB.NET, and JScript.NET. C# is largely a “copy” of Java. VB.NET and JScript.NET are extensions of Visual Basic and JScript for the .NET platform. This platform makes available to programs running within it a very large set of classes, classes very similar to those found within Java virtual machines. As a first approximation, we can say that the .NET platform is a runtime environment analogous to that of a Java virtual machine. However, two important differences should be noted:

  • The .NET platform runs only on Windows machines, whereas Java runs on various operating systems (Windows, Unix, Macintosh).
  • The .NET platform allows the execution of programs written in different languages. All that is required is for the compiler to be able to generate IL (Intermediate Language) code, which is executed by the .NET virtual machine. All .NET classes are available to .NET-compatible languages, which tends to blur the differences between languages to the extent that programs make extensive use of these classes. Choosing a .NET language is more a matter of preference than of performance.

Just as Java cannot be ignored, neither can the .NET platform, due both to the vast number of Windows machines in use and Microsoft’s efforts to promote and establish it. C# appears to be a good choice for getting started with .NET, particularly for Java programmers, given how closely related the two languages are. Afterward, one can easily switch from C# to VB.NET or another .NET language. The syntax will change, but the .NET classes will remain the same. Contrary to appearances, the transition from VB to VB.NET is difficult. VB is not an object-oriented language, whereas VB.NET is entirely so. VB programmers will therefore be confronted with concepts they are not familiar with. It seems easier to tackle these by setting aside what you know about VB. Therefore, we make only a few references to VB in the following.

This document is not a comprehensive course. It is intended for people who already know programming and want to learn VB.NET. It follows the structure of the document "Introduction to the C# Language" by the same author to facilitate comparison between the two languages. In fact, I have used automatic C#-to-VB.NET translators here. While not entirely perfect, these translators nevertheless do 80 to 100% of the work, depending on the case. So, when reading the VB.NET program code that follows, keep in mind that it was first generated by a machine and then revised by me as needed. You’ll therefore encounter programming “phrasing” that you might not have used yourself.

The following books were helpful to me:

  • Professional C# Programming, Wrox Publishing
  • C# and .NET, Gérard Leblanc, Eyrolles

These are two excellent books that I recommend reading. The translation of the C# programs into VB.NET was obtained using a translator available at the URL (March 2004) http://authors.aspalliance.com/aldotnet/examples/translate.aspx. Everything else was obtained using the Visual Studio.NET documentation.

Serge Tahé, March 2004