Visual Basic (.NET)
File:Vb dot net.png | |
Paradigm | structured, imperative, object-oriented |
---|---|
Designed by | Microsoft Corporation |
First appeared | 2001 (last revised 2005) |
Typing discipline | dynamic, strong, unsafe[1], nominative |
Website | docs |
Major implementations | |
.NET Framework, Mono | |
Dialects | |
Microsoft Visual Studio .NET, .NET 2003, 2005 | |
Influenced | |
None |
Visual Basic .NET (VB.NET) is an object-oriented computer language that can be viewed as an evolution of Microsoft's Visual Basic (VB) implemented on the Microsoft .NET framework. Its introduction has been controversial, as significant changes were made that broke backward compatibility with VB and caused a rift within the developer community.
The great majority of VB.NET developers use Visual Studio .NET as their integrated development environment (IDE). SharpDevelop provides an open-source alternative IDE.
Like all .NET languages, programs written in VB.NET require the .NET framework to execute.
Versions of Visual Basic .NET
As of November 2006 there are three versions of Visual Basic .NET.
Cross-platform and open-source development
The creation of open-source tools for VB.NET development have been slow compared to C#, although the Mono development platform provides an implementation of VB.NET-specific libraries and is working on a compiler, as well as the Windows Forms GUI library.[citation needed]
Hello World Example
The following is a very simple VB.Net program, a version of the classic "Hello world" example:
Public Class ExampleClass Public Shared Sub Main() System.Console.WriteLine("Hello, world!") End Sub End Class
The effect is to write the text Hello, world! to the output console. Each line serves a specific purpose, as follows:
Public Class ExampleClass
This is a class definition. It is public, meaning objects in other projects can freely use this class. All the information between this and the following End Class
describes this class.
Public Shared Sub Main()
This is the entry point where the program begins execution. It could be called from other code using the syntax ExampleClass.Main()
. (The Public Shared portion is a subject for a slightly more advanced discussion.)
System.Console.WriteLine("Hello, world!")
This line performs the actual task of writing the output. Console is a system object, representing a command-line console where a program can input and output text. The program calls the Console method WriteLine, which causes the string passed to it to be displayed on the console.
See also
Notes
- ^ Only if strict type checking (
Option Strict
) is not enabled. Many VB.NET developers assert that strict type checking must be enabled in all new projects and only disabled for legacy code converted by the Upgrade Wizard.
External links
- Microsoft's VB.NET website
- Visual Basic 2005 Express Edition website
- VBRun website - legacy VB6 resources from Microsoft
- Legacy Transformation
- SharpDevelop - a free IDE for VB.NET, C# and Boo programming language
- Mono implementation of VB.NET
- Doing Objects in VB.NET and C#, a free eBook
- Free source code for VB.NET programmers
- Visual Basic 2005 Learning Guide From SearchVB.com
- Xtreme Visual Basic Talk forums
- Directory of Visual Studio components and controls