Learning the Visual Basic .NET Language - The Evolution of VB .NET
(Page 2 of 9 )
Traditional ASP development was restricted to the VBScript programming language, which was first developed as a basic scripting language for writing macros and other simple code that would be used by another application. VBScript was never intended for sophisticated, interactive web applications, hence expert programmers had to strain the language to its limit to create first-rate ASP pages. To get around many limitations in VBScript, advanced pages needed to rely on separate components written in other languages, which generally had to be installed and configured separately on the web server. In the end, even though VBScript was intended to be easier to use than ordinary Visual Basic, writing advanced ASP pages actually became much more complicated because of the additional effort needed to circumvent VBScript’s limitations.
Just replacing VBScript with Visual Basic would have been a significant advantage. Some of the features Visual Basic 6 offers that VBScript lacks include the following:
- Access to the platform services. VBScript, on the other hand, is automatically isolated by the scripting host and has many security-related restrictions.
- Typed programming. VBScript doesn’t allow you strict control over data types, and works with special “variant” variables instead, which are supposed to be easier to use. Unfortunately, they also introduce data type conversion problems and difficult-to-detect errors.
- Event-driven programming. Unlike Visual Basic, VBScript is notoriously disorganized and has little flexibility to group or organize code so that code can be easily debugged and reused.
- Support for objects. Visual Basic doesn’t have perfect object-oriented features, but they are still light years over what VBScript can accomplish.
However, ASP.NET has completely skipped over this stage in evolution and moved directly to the advanced capabilities of Visual Basic .NET. This latest version of Visual Basic is a complete redesign that answers years of unmet complaints and extends the VB language into new territory. Some of the new features include the following:
- Structured error handling. The end of the aggravating “On Error Goto” construct has finally arrived. VB .NET introduces .NET’s new standard: clean, concise, structured exception handling. You’ll see it in Chapter 11.
- Language refinements. Every aspect of the VB language has been tweaked and refined. You can now overload functions, declare and assign variables on the same line, and use shortened assignment syntax.
- Strong typing. Even Visual Basic 6 performed some automatic variable conversions that could cause unusual bugs. VB .NET allows you to rein in your program and prevent possible errors with strict type checking.
- True object-oriented programming. Inheritance, interfaces, polymorphism, constructors, shared members and abstract classes…the list goes on, and Visual Basic .NET integrates them all into the language.
These are only some of the changes, but they’re enough to show you that VB .NET is separated from VBScript by two major evolutionary leaps. All of these features are available in other .NET languages such as C#, but Visual Basic and VBScript developers will have to adjust the most.
Next: Variables and Data Types >>
More Visual Basic.NET Articles
More By Apress Publishing
|
This article is excerpted from chapter three of the book Beginning ASP.NET in VB.NET: From Novice to Professional, written by Matthew MacDonald (Apress, 2004; ISBN: 1590592786). Check it out at your favorite bookstore today. Buy this book now.
|
|