What's new in Visual Basic 2010

Visual Basic 2010 has some good new features, the most exciting ones (our opinion) of which are shown below.  You might also like to look at the list of new features in Visual Studio 2010 and ASP.NET 4.0 changes.

Specific new or changed features in Visual Basic 2010 include:

New/changed Visual Basic 2010 feature - AUTOMATIC CODE SELECTION

When you select a keyword in VB code, Visual Studio now highlights all other keywords forming part of the same construct:

Automatic code selection

New/changed Visual Basic 2010 feature - NO MORE CONTINUATION CHARACTERS

You no longer have to use the underscore continuation character at the end of a broken line:

No more continuation characters

New/changed Visual Basic 2010 feature - THE MAGIC ALT KEY

You've been able to hold down the ALT key while selecting code for some time, to select a rectangular block of text.  However, you can now type into the selected block, which may (as in the diagram below) be zero characters wide.  This allows you to insert the same text into a number of lines of code simultaneously - marvelllous!

The magic ALT key

New/changed Visual Basic 2010 feature - AUTO-IMPLEMENTED PROPERTIES

How often have you created properties like the one called Owl2 below?  Now you can do it in one line of code - for the Owl1 property below the private variable _Owl1 is automatically created for you, although not shown:

Auto-implemented properties

New/changed Visual Basic 2010 feature - GENERATE FROM USAGE

To speed up coding, you can automatically create a property in one class while writing another.  Choosing the option below would automatically create an Author property in the clsTest class.

Generate from usage

New/changed Visual Basic 2010 feature - COLLECTION INITIALISER

If you know the elements in a collection, you can create it in a single line of code (the example shown here, however, shows doing the same thing to create an array).  Microsoft seem enthusiastic about this change, but it doesn't save much coding and doesn't make code clearer to read.

Collection initialiser

You can view a full list of changes in recent versions of Visual Basic by returning to our main Visual Basic version history page.

.NET versions

All content copyright Wise Owl Business Solutions Ltd 2012.  You can follow us on FaceBook. All rights reserved.