VB.NET Provides Power and Productivity
by Kathleen Dollard
October 2003 Issue
 |
|
Kathleen Dollard
|
Agree? Disagree?
Let us know by
e-mailing us at . The opinions expressed in this editorial are those of the author and not necessarily the opinions of VSM.
|
I love VB.NET. Bringing VB into .NET merges VB's historic productivity with the .NET platform's power. Upcoming versions of VB can build on this base to become more productive and more powerful. A return to fundamentals such as Edit and Continue, along with creative new features, will enhance productivity. Generics and operator overloading will bring new power to VB.NET. But you don't need to wait—VB.NET already provides a solid implementation that focuses on productivity.
.NET languages use the .NET Framework and compile to Intermediate Language, so it's easy to assume they're the same. However, each has an independent implementation arising from its own compiler. The VB compiler supports special language features such as enhanced type conversions. Some of the functions in the optional VB library offer unique functionality within the framework. The languages also differ in philosophy: VB focuses on human productivity, and C# on language. They come from different backgrounds, but overlap to a significant degree (see Figure 1).
VB.NET provides productivity in four principal ways: verbosity, predictability, safety, and approachability. Verbosity allows you to use English-like syntax that makes it easy to read and understand source code. You gain readability while typing less, thanks to VB.NET's robust statement completion and IntelliSense. VB.NET also provides declarative syntax for events (Handles and WithEvents) and interfaces (Implements vs. name-based mappings). Declarative syntax indicates how you use something in the logical location—as part of its declaration.
Predictability means that VB matches your intuitive thinking. For example, if you assign 2/3 to a double in VB.NET, the result is 0.666666666666667, whereas the C# result is zero. VB.NET also turns on integer overflow checking by default; for example, adding 1 to an Int16 containing 32767 raises an exception rather than returning –32768.
VB provides a high level of programming safety. For example, you can't write unsafe code in VB.NET. It's called unsafe for a reason: The compiler can't protect you from writing outside the expected memory space, which can create chaos in your system and be extremely difficult to track down.
Approachability lets you become effective quickly and remain effective when you don't work in the language full-time. It means an easier learning curve and fewer details to worry about. VB.NET's approachability features include great IntelliSense, being locale-aware by default, navigation combo boxes in the code editor, and letting you postpone learning about delegates. The Imports statement helps you learn the .NET Framework's namespaces. You can import part of a namespace (such as "Imports System"), then include the remainder (such as "Data") as part of the class reference. This style gives you better IntelliSense and greater readability.
VB.NET's productivity helps you do the job right the first time, quickly. The language includes dozens of unique productivity details. The With statement saves typing and improves readability, modules let you access functionality anywhere in your application, and optional parameters make creating certain types of methods easier while simplifying working with external methods that use optional parameters. VB.NET's background compiler offers realtime squigglies and Task List feedback for your whole project to make your programming time more effective.
I don't choose VB.NET because of legacy applications, or because I'm allergic to semicolons or struggle with case sensitivity. I choose it because I love today's features and tomorrow's direction. The changes in 1.1 are small, but they confirm VB.NET's trajectory. Bit-shift operators improve the technical side, snippet and Web class conversions improve VB6 migration, and Try/Catch completion and most frequently used IntelliSense improve usability and productivity. This small point release shows VB heading in the right direction in Whidbey and beyond.
About the Author
Kathleen Dollard is an independent consultant doing real-world development in .NET technologies. She's active in the Denver Visual Studio User Group and is a regular contributor to Visual Studio Magazine, a Microsoft MVP, and a VSLive! speaker. Kathleen's also writing a book on code generation in Microsoft .NET for Apress. Reach her at . Back to top
|