: Visual Studio Whidbey provides numerous productivity enhancements, starting with the built-in "code snippets" available from the right-click context menu in the code editor, which now displays an "Insert Snippets" menu item. According to Jay Roxe, VB Product Manager for Microsoft, Whidbey will ship with around 500 pre-built snippets arranged in categories that match common programming needs, such as string, file, and registry manipulation. You're not limited to using Microsoft-supplied snippetsyou can easily add custom categories and snippets that meet your needs. The presenters used the snipped feature extensively. There have been numerous ways to package and reuse code over the years, and certainly, integrating the capability directly into the IDE is a big step forward. However, I suspect that the usefulness of the feature is in inverse proportion to the number of snippets availableand I fully expect the feature to be abused. It's one thing to select a snippet you already know is appropriate from a list of hundreds, and quite another to try to select an unfamiliar snippet to perform a known task. In other words, the power of having snippets wanes when developers end up spending more time hunting for the right
snippet than it would take to simply write the code.
Edit and Continue
: Yes, edit and continue is back. That's not a new announcement, but Microsoft speakers proudly highlighted it in their presentationsand it finally seems to have moved past the promise stage into working code. E&C was the most-requested feature for the next version of VB.NET. Although the capability for E&C is baked into the framework, each language group has to choose whether to surface it for that language. Edit and continue was one of my favorite VB classic language features and even though I've had to forego E&C for the last few years in .NET, I still feel strongly that it's one of the best productivity features ever invented.
The "My" abstraction: Visual Basic developers have long used the keyword "Me" to refer to the currently executing form or class (the equivalent in C# is "this"), but they'll soon become just as familiar with the new "My" designation for the root of a namespace. Characterized by Microsoft speakers as a "speed dial into the framework," the My namespace contains classes that give you fast access to commonly used features of the system, the user, and the framework, making them both easier to find and far easier to use. In addition, former VB developers will be happy to note that the My feature brings back the concept of a global forms collection. For example, in VB.NET 2003, if you have a form in your project called "frmMain," you must first create an instance of it and assign that to a variable before you can use the form. In contrast, VB6and now VB.NET Whidbeyautomatically create a global list of forms that you can use without first creating an instance variable.
frmMain.Text1 = "Hello World"
Dim fMain As New frmMain
fMain.Text1.Text = "Hello World"
My. Forms.frmMain.Text1.Text = "Hello World"
Similarly, you can get a list of printers using "My.Computer.Printers", or trap global application events such Startup and Shutdown exposed by the My.Application class. And for the first time, it's easy to add a global exception handler by handling errors at the application level via an Error event. The My.User class gives you fast access to the logged-on user. The sidebar "Exploring the My Namespace" contains a more complete list of the available functionality.
Better Exception Information: Rather obviously, developers spend a good deal of time fixing errors in their code, so any assistance an IDE can offer there will pay high dividends. Rather than simply showing you the exception, VS now also analyzes the surrounding code, and in many cases can not only offer possible solutions, but also includes clickable links in the exception display that fix the code for you. While more error information is often good, it remains to be seen how much time developers will actually save with this feature.
Smart Code Generation: Visual Studio provides extensive code-generation features, such as creating fully functioning "smart" forms. In one demonstration, selecting an object type caused VS to analyze the object's schema and produce a fully working, type-aware data-entry form suitable for editing the object.
In the 2003 version of the framework, some of the base functionality was "baked in," making it very difficult to change without extensive work. For example, the ASP.NET out-of-process Session manager worked very nicely with SQL Server, but if you wanted to use Oracle, you couldn't simply switch out the databaseyou had to write your own Session manager. Because Enterprise customers often need to swap out such functionality, the Whidbey version lets you do so at very high levels quite easily. In ASP.NET, for example, you can use the My.User class to determine whether a user is authenticated. The default implementation uses Windows authentication, but you can easily write a different authentication provider. You might think that writing a custom authentication provider would interfere with other built-in functionality, such as My.User, but it works seamlessly; the My.User class will reflect the results of the custom authentication rather than the Windows authentication.
Such extensibility makes the framework far more flexible than previous versions, and extends its reach into the enterprise levels where applications must play more nicely with others.
A new security calculator analyzes your code for security requirements. To use it, you set the permission level at which your application needs to run, and then the tool warns you about code needed to run the application successfully that would not run without additional permissions. In addition, you can set a permission level and then run your application in different "modes" to determine how it will act when running in different target security permission levels.
Bill Gates mentioned a PREFast tool that Microsoft has been using internally to find potential security problems with code. PREFast looks for known code patterns that can lead to problems or that are vulnerable to malicious attacks. Gates said the tool has proved to be so successful that Microsoft will include it in Visual Studio.
New Web services security standards, such as WS-Security will appear with Indigo, which should ship somewhere between this Whidbey release and the Longhorn release.