28‏/05‏/2009

Not so Hidden Gems in VS 2010

Not so Hidden Gems in VS 2010
I’m just going to assume that all readers of my blog know that Visual Studio 2010 Beta one has been released.

I’ve been running it almost exclusively since I downloaded and installed it. There’s a lot to like. For this first post, I’m going to limit my discussion to a very small set of IDE features that thrill me in the new release.

Tear away editor and tool windows
This is a neat feature for single monitor work, but is absolutely wonderful in a multi-monitor scenario. In VS2010, you can grab the title tab in an editor window (design or code window) and move it out of the VS IDE frame window. It’s wonderful when you’re trying to do some work that requires examining more than one code file at a time.

The fact is that this feature works for tool windows as well as editor windows. In my setup, I’ve tried to maximize my main code window in the main monitor. Properties, Solution Explorer, and the build output windows are on the secondary monitor. I’ll pull editor windows out when I need to see multiple code (or designer) files for a particular task.

PascalCased IntelliSense
Love this for discovering classes or methods in the .NET Base Class Libraries. Intellisense now picks up targets that contain the words you type, even if they are not at the beginning. For example, if you type ‘enumer’ in a code window, Intellisense will (as always) contain Enumerable. It will also contain IEnumerable, IOrderedEnumerable, and ParallelEnumerable.

It’s a great way to discover something that might be the solution to your current coding problems.

Real TDD Support: Generate From Usage
Create From Usage means you can really follow a TDD methodology. You can right test scenarios that describe how you want to use a class. Once you’ve written the test, you have a test that doesn’t compile (like now). Right click on each item with red squiggles and select “Generate”. Types allow you to generate a new class (quick default), or “Generate Other” which displays a dialog that lets you select a class, interface, enum, or struct. Furthermore, that dialog lets you select the access modifiers on the type, select a destination project (if you have multiple projects in your solution). You can follow the same workflow to generate methods or properties once you’ve created the types.

The IDE will create members that throw NotImplementedExceptions, so all your tests will fail. But, isn’t that the point of TDD? Once you have those failing tests, you have a task list to make them green.

In future posts, I’ll touch on more of the major features in VS 2010. I wanted to start with these hidden gems because they can be so easily overlooked if you just start using the new version with your old work patterns.