Visual Basic .NET

   

Visual Basic.NET in Microsoft Visual Studio 2003
Enlarge
Visual Basic.NET in Microsoft Visual Studio 2003

Based on Microsoft's Visual Basic (VB), Visual Basic .NET (VB.NET) is a computer language which can be viewed as an evolutionary development from VB version 6.0 and earlier. The changes in the computer language are targeted to use Microsoft's .NET Framework and to bridge the gap between it and other .NET languages such as C#. Visual Basic .NET is, in general, syntactically similar to Visual Basic, but includes object-oriented features and an object hierarchy based on the .NET framework that makes it a more complex system as compared to other variants of BASIC. A migration wizard is available in Visual Studio .NET, although many features must be recoded by hand due to the extensive changes in the object library.

Like C#, VB.NET compiles to Common Intermediate Language (CIL) which needs to be JITted as it is executed. The CIL produced by VB.NET is identical to that produced by C#, which is why C# and VB.NET (and Managed C++ for that matter) can communicate directly with one another. Though the CIL is identical between languages, C# has some features that VB.NET lacks, and vice versa. For example, VB.NET supports late binding, where the type of an object (or variable) can be determined at run-time.

Evolution from earlier versions of Visual Basic

Visual Basic starting from version 1 through version 6, and now in the version called .NET, became more complex, albeit more powerful, with each revision. The following simple example gives an idea

Classic VB example:

 Private Sub Command1_Click()
 &nbsp
    MsgBox "Hello, World"
 &nbsp
 End Sub

A VB.NET example:

 Private Sub button1_Click(ByVal sender As System.Object, _
                           ByVal e As System.EventArgs) _
                           Handles button1.Click
 &nbsp
       MessageBox.Show("Hello, World")
 &nbsp
 End Sub
  • Alternatively, the MessageBox.Show("Hello, World") can be written as MsgBox("Hello, World"). (Note that all parameters to procedure calls must now be surrounded by brackets.)

There is extensive documentation that covers changes in the syntax (rules of the language), the changes in debugging applications, deployment and terminology.

Controversy concerning VB.NET

Many long-time Visual Basic programmers have complained loudly about Visual Basic .NET, because it drops a large number of language features that were in earlier versions of Visual Basic (which are now no longer sold). However, to balance the argument, VB.NET is a more powerful language in many respects, incorporating modern object-oriented programming paradigms. Indeed, some experts in Visual Basic .NET have characterized it as an entirely new programming language. Visual Basic programs that relied heavily on such features as databases and graphics will, in general, have difficulty in migrating to VB.NET, while programs that are mainly algorithm based, such as mathematical programs, can be migrated with fewer difficulties.

For Visual Basic 2005, the successor to VB.NET, Microsoft is adding features that will reintroduce some of the ease of use that previous versions of VB had, including a class library called My that allows programmers to more easily access the capabilities of the .NET framework.

External links

See also



de:Visual Basic .Net es:Visual Basic.NET ja:Microsoft Visual Basic .Net zh:VB.NET

Retrieved from "http://www.mywiseowl.com/articles/Visual_Basic_.NET"

This page has been accessed 466 times. This page was last modified 21:36, 31 Oct 2004. All text is available under the terms of the GNU Free Documentation License (see Copyrights for details).