| FazBrowse Wikipedia Viewer | Main Page | | |
| Viewing: https://en.wikipedia.org/wiki/Comparison_of_Visual_Basic_and_Visual_Basic_.NET |
can now be written as:
A procedure call must have parentheses in Visual Basic .NET.
Visual Basic .NET requires a ByVal or ByRef specification for parameters. In Visual Basic the specification could be omitted, implying ByRef by default. Most development environments, such as Visual Studio .NET, will automatically insert a ByVal, so in effect the default is ByVal, not ByRef. There are tools to convert Visual Basic code to VB.NET, such as the Visual Basic Upgrade Wizard that was included in Visual Studio .NET 2002 and 2003. Conversion tools automatically insert a ByRef if necessary, preserving the semantics of the Visual Basic application.
Visual Basic 5.0 and 6.0 has traditionally employed zero-based arrays (the default lower bound), unless "Option Base 1" is declared. This was the source of many out-by-one errors in Visual Basic programs, especially when dealing with interoperability across program library boundaries. Although the .NET Common Language Runtime can support arrays with any base value, Visual Basic .NET and C# provide only zero-based arrays and lists, and the .NET Common Language Specification requires zero-based arrays for interoperability between .NET languages.
Visual Basic .NET introduced the concept of a jagged array, whereby the rows can have unequal length as opposed to the uniform length of arrays imposed on Visual Basic programmers.
In languages compiling down to .NET platform, types are strict. Whilst the runtime allows for anonymous object which don't have a pre-defined, named type, the type of a variable may not change over the course of its life-time, hence the need to drop the Variant data-type. However, type "Object" has somewhat similar behavior in practice.
Visual Basic was an object-based language. It supported classes, but not other concepts that would make it an object-oriented language. Visual Basic .NET is a true object-oriented language with the following features:
Although no language targeting .NET allows for multiple inheritance for classes—multiple inheritance of interfaces is supported.
Whilst the IDE does a reasonable job of hiding the fact, the dependence on ActiveX objects is dropped in Visual Basic .NET (although there are mechanisms for interfacing with COM in .NET ) in favour of .NET components offering similar functionality. This shift is good for the Visual Basic developer since much of the performance issues in Visual Basic arose around the cost of the COM interface.
One of the true banes of a Visual Basic developer's life has always been writing resize code. Whilst the WinForms paradigm leaves a lot to be desired in the geometry management department in the face of toolkits like Qt and GTK+, at least the developer can anchor widgets on forms instead of having to write reams of code in OnResize handlers.
In Visual Basic .NET, Option Explicit is on by default.
| View original on Wikipedia | Back | FazBrowse Home |