Visual Basic

  1. Home
  2. Computing & Technology
  3. Visual Basic

By Dan Mabbutt, About.com

* Visual Basic Language Changes

You might think that there really wouldn't be much to change in the actual Visual Basic language itself. You might be wrong if you did. In fact, Visual Basic itself has changed quite a bit in the 2005 version.

Probably the most significant change is the addition CLS (Common Language Specification) conformance checking. The CLS is the set of rules that is designed to guarantee interoperability between different .NET languages. If a program checks out as CLS compliant, that object will work the same way whether the source is VB 2005, C#, C++, or any other .NET language that runs under the Common Language Runtime. If a line of code isn't compliant, the new compiler will generate a warning.

To make sure that VB.NET 2005 can generate CLS compliant code, it supports the 11 CLS compliant primitive data types:

  • Byte
  • Int16
  • Int32
  • Int64
  • Single
  • Double
  • Boolean
  • Char
  • Decimal
  • IntPtr
  • String

To conform with CLS, VB now supports both signed and unsigned integers too.

The next most significant change to the actual language itself is the addition of generics to the language. Microsoft defines them this way:

A generic type is a single programming element that adapts to perform the same functionality for a variety of data types. When you define a generic class or procedure, you do not have to define a separate version for each data type for which you might want to perform that functionality.

You can use generics to avoid late binding or type conversion (which can avoid errors and make your code run faster), and to provide more flexibility by allowing code to accept several types without declaring the different types independently. Generics can be recognized in VB code by the use of the Of keyword.

Other new language elements include the Continue statement for more flexible looping, the IsNot Operator to make your conditional statements read more clearly, and the Using statement to define system resources for a block of code and then release them again after the block completes.

The net of all this, in my book, is that VB.NET 2005 isn't a "nice to have" update, it's a required update. If you haven't moved up already, do yourself a favor and get aboard the 2005 and Framework 2.0 train. Or you'll be left at the station.

Explore Visual Basic

By Category

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Visual Basic

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Using VB.NET
  5. What's New in Visual Basic 2005!

©2009 About.com, a part of The New York Times Company.

All rights reserved.