Top Five Visual Basic .NET Tips

The .NET Framework and Visual Basic .NET represent a huge departure from the Visual Basic 6 programming environment. Some developers may see this as daunting, but I see it as exciting. The changes that Microsoft has made to Visual Basic have been made for the sole purpose of making it a better tool for writing professional applications in the coming years. I think they have succeeded. Every time that I dig down to find out how "X" is done in .NET, I'm always pleasantly surprised by the simplicity and elegance of the solution. I think you will be too. Here are my top five tips on how to get comfortable with Visual Basic .NET.

1. Spend time with the .NET Framework classes

The hard part about moving up to Visual Basic .NET is not the language, but learning to use the types provided in the .NET Framework class library. The class library wraps all of the functionality provided by the Windows operating system and the .NET common language runtime. It provides types for creating GUI applications, Web apps, and Web services. It provides code for accessing data in SQL Server and other database, code for working with regular expressions and XML, code for low-level network access, and so on. In fact, there are about 4,000 types defined in the .NET Framework class library. The good news is that all .NET languages access the .NET Framework class library in the same way, meaning that once you've mastered the class library, you can move from language to language with relative ease.

So, how do you master the .NET Framework class library? Start with a good class browser. All .NET types are self-describing, and a number of .NET enthusiasts have written applications for browsing type information. There is a very good one available called Reflector, written by Lutz Roeder at Microsoft, which can be downloaded for free from his
Programming .NET Web site.

Browse the assemblies, modules, types, and type members found in the .NET Framework class library

Browse your own or third-party assemblies

Reverse-engineer declarations in either Visual Basic .NET or C# (and potentially other languages as new plug-ins become available)

View any method's disassembled IL, as long as the method wasn't written directly in native code. (IL is the compiled code of any .NET application.)

In addition, there are plans for adding the ability to reverse-engineer source code in C#.

Another great tool is Anakrino, written by Jay Freeman. It too can be downloaded for free. In addition to being able to browse Microsoft and third-party assemblies and show disassembled IL, Anakrino can actually decompile IL code into C# code. That is, it generates C# code that, if compiled, would produce the IL that was fed to it (regardless of the language in which the component was originally written). Unfortunately, at the time of this writing, there are no plans to add a Visual Basic .NET decompiler to the product.

2. Use the Web

You are not alone! There is an amazing amount of brainpower floating around in cyberspace. If you are stuck, you need never stay stuck for long. Here are some of my favorite hangouts on the Web.

Discussion Lists

Discussion lists are one of the greatest resources on the Internet. These give you the opportunity to ask questions of tens, hundreds, or thousands of people who are in your field of interest. The Web URLs listed here link to pages that provide instructions for subscribing to the lists.

Netiquette

If you've never before been a member of a discussion list, take care to note the concept of netiquette. This term refers to the rules of behavior expected from people who post messages to discussion lists. You will receive or be directed to a list of such expectations when you subscribe to a list, but they can be summed up as follows:

This is my all-time favorite .NET hangout. There are many heavy hitters on this list, including Microsoft development team members and program managers as well as third-party experts who were learning and using .NET as much as a year or two before it's official release.

This site is amazing for its breadth of coverage. There are over 400 highly focused, moderated lists available through this one site. Many of these are now .NET-related, and many are available in languages other than English.

The members of this list discuss everything related to Visual Basic, including Visual Basic .NET and earlier versions. This is a large, very active list with developers of all skill levels. There are plenty of advanced Visual Basic developers on this list who are ready to lend a hand when they can. There are approximately 4,400 subscribers.