Saturday, March 03, 2012

Visual Studio 11: First Impressions

So, like probably every other C# developer in the world, I downloaded and installed the Visual Studio 11 beta a few days ago. I've decided to start using it for all of the sample code for the blog, so I thought I'd give you some early impressions.

The usual caveats apply, of course. This is a beta so I'm not terribly worried about bugs yet; I'm mostly interested in the new features and enhancements. Also, I'm playing with the Ultimate edition of VS11 but I will probably only end up using the Premium edition, so I'm going to ignore some of the advanced features that aren't part of Premium. That said, lets take a look.

Black And White And Ick All Over

So, lets address  the obvious elephant in the room up front: the god-awful ugly new color scheme. Frankly, I'd like to just skip this part of the discussion and move on. As I've said before, I don't use Visual Studio because it's pretty; I use it because it's effective. However, Microsoft is actively making an issue of this new color scheme as somehow being a productivity improvement, so let me respond: that's complete bull. If anything, its annoyingly distracting: I notice the color scheme in VS11 much more than VS2010, though mostly because I don't like it. When I'm writing code, it doesn't make any difference what color my menu and toolbar are, but every time I go to click on one of them I pause and shake my head before moving on.

After a short while, you learn to deal with the colors, just like I mostly ignore the color scheme in any other editor. Which is really my main complaint about the new color scheme: it's pointless. Colors are irrelevant, and trying to convince a community of developers that can't even agree on black or white backgrounds that your arbitrary color scheme is "better" than some other arbitrary one is a level of stupidity I don't usually expect from Microsoft.

Here's an idea that would save us all a lot of headache: let me pick my own colors. We all know it's written in WPF, so why not provide a way to plop my own styles in there? Or, I dunno, match the Windows color scheme like any well-behaved app is supposed to? Of course, it would be particularly awesome if they gave us the same flexibility of Eclipse and let me configure my colors myself, but I wish that about every IDE. (Except Emacs. You just sort of give up with Emacs and drink the Kool-Aid.)

Ultimately, though, the colors are irrelevant. My real complaint is the icons. Here's a comparison of the Solution Explorer icons from VS11 and VS2010:

Visual Studio 11 Icons
Visual Studio 2010 Icons

If you are anything like me, the first thing you'll notice is how much easier it is to differentiate the icons on the right. (Note: The VS11 Solution Explorer has many more icons, as you can see. I'll come back to this later. The overlap here starts with the 7th icon from the left). The "View Code", "View Designer", and "View Class Diagram" buttons in VS2010 look like a code file, a form designer, and a model diagram under a magnifying glass. The same icons in VS11 look like.. I dunno. An empty XML tag, a stop button, and I guess a class diagram. Microsoft has taken the absolute worst UI feature of the iPhone -- meaningless, empty, flat icons -- and ported it to an environment with pixels and colors to spare.

The other major visual change that Microsoft is touting is that VS11 is "less obtrusive" and gives you "more working area" than VS2010. Unfortunately, I just don't see it. Now, I will admit that out of the box, VS11 isn't showing me as many useless toolbar buttons as VS2010 did. In VS2010, my entire 1600-pixel-wide toolbar is full, and opening any more pushes them into a second row. In VS11, less than half of that space is used up. And, for the record, I have the same two toolbars open in both: Standard and Text Editor; most of the buttons are just turned off. Also, they've removed the icons from docked windows, allowing the window titles to be BIGGER AND IN ALL CAPS. It's annoying at first but again, I quickly got used to it.

Beyond that, however, the difference is negligible. There's some extraneous white space removed from VS11, which, frankly, I always found annoying in VS2010, since it didn't exist in previous version. Areas like the tab row and docked-hidden windows no longer have a lot of extra padding around them, in step with the "flattened" look VS11 is going for. Otherwise, if I have the same windows and toolbars visible and docked in the same location, the client areas are nearly identical: VS11 gives me a 1513x677 code editor window, and VS2010 gives me 1507x665, close enough for me to blame my Snipping Tool skills.

Solution Navigator For The Win

Well, with that out of the way, on to the real stuff. The very first cool feature about VS11 that I notice is that, when I opened up my project from the proxyless WCF service posts -- nothing happened. VS11 solutions and projects are completely compatible with 2010. There is no upgrade process involved, meaning I can safely switch back and forth between the two versions without disrupting anyone else's environment.

That's not entirely true: my WiX version doesn't support VS11 yet but that's WiX's problem, not Microsoft's. VS11 also upgraded my database project a tiny bit, but there is an add-in for VS2010 to support this new format already, so that shouldn't be a problem.

The next cool feature I notice, which you've already seen, is the enhanced Solution Explorer tool window. If it looks familiar to you, that's probably because it's the Solution Navigator window from the VS2010 Productivity Power Pack extension, which I use exclusively in VS2010. Compare the VS2010 Explorer tree to the VS11 one and you immediately see why one is more awesome than the other:
Visual Studio 2010 Solution Explorer
Visual Studio 11 Solution Explorer

The new Explorer view drills down way past the file level, providing a merged "File Explorer" and "Class Explorer" view reminiscent of Eclipse. Also, you can't see in the screen shot above, but because I have the "Preview Selected Item" checked, when I selected the Operation member of my Result class, the code editor window navigated right to it and highlighted it for me. Also notice the Search bar inside solution explorer:
Ran a Search in Solution Explorer
This is where the next/back buttons come into play, by the way: they navigate back and forth across the various rooted views in the Solution Explorer. You can also right-click on any container and "Scope To This" to re-root the explorer on that element.

Simplified Menus

The menu selections in VS11, much like the toolbar buttons, are dramatically trimmed down. Compare the Project menus, for example:
Visual Studio 2010 Project Menu
Visual Studio 11 Project Menu
Notice that 95% of the VS2010 project menu is identical to the project context menu in Solution Explorer; I know I've never once used the main menu to add a class to my project. The remaining items are also in the context menu but they are so rarely used, it makes sense to keep them in the main menu where they can be discovered. Other menus have also been cleaned up: the Test menu is now the Unit Test menu and only contains menu items for dealing with running and configuring tests; the Data menu has been split into SQL (for dealing with servers) and Data (for dealing with data sources.)

TFS Improvements Abound

One thing I'm particularly excited about are all the new TFS improvements in VS11. And it doesn't take long to notice them: Team Explorer has been completely rewritten! For starters, the tree view is gone, replaced with a more task oriented layout. (Not sure I'm totally digging all the wasted space but I'll adapt.) The Pending Changes view is no longer separated out; it's part of the Team Explorer window. Even more importantly, there's only one of them: choosing to Check In... from Solution Explorer no longer pops up a separate and not-in-sync Pending Changes window, but navigates you to the Team Explorer one. Which, by the way, is impressive:

Its the little things that impress me, really: I know go to the same place to Shelve and Check In changes, and I don't have to flip back and forth to associate work items and see if my check-in is going to be allowed.

The next thing I did was intentionally cause a merge conflict with one of my files, so I could see the new merge conflict resolution tool. Holy cow. The following screen-shot is huge, but really, it's just that impressive (the blurry grey lines are, of course, not in the original; this product is not out yet so I'm being extremely cautious how much I reveal about what it is/does):


Everything I hated about the previous conflict resolution editor is gone. For starters, it's now very clear which file is which: a Server version, a Local version, and a Result, with the file name (and not the first part of the path) clearly visible. The three views sit side-by-side, making it much easier to keep track of where you are in each one. But the best part I can't even show you in the screen shot: Intellisense in the editor. It has limits: it doesn't seem to recognize any user-defined types, and it doesn't do type inference. But it provides full Intellisense for any explicitly typed Framework objects, plus code completion where possible. The headers are also navigation helpers: you can see what method you are in for each pane, and jump around in your code as well. Resolving the conflicts is a bit easier to see, as well: check off the appropriate check box and the Result updates itself to match, changing the colors on the selected and rejected edits. (The pale green color is a bit harsh, but hopefully that's editable.)

Premium Edition Gets Some Love

VS11 comes with a number of other bundled tools that were previously external products. All editions ship with Blend, the stand-alone WPF editor. They also include LightSwitch, which as near as I can tell, is a sortof lightweight development environment for people too lazy/busy to learn how to program in a real IDE. (I get the impression that LightSwitch is the FrontPage to Visual Studio's Dreamweaver.)

From what I've read, VS11 Premium is also getting a lot of features that were previously only available from the Ultimate edition, or external products. For example, the features of the Microsoft Test Manager tool (fast-forward tests, exploratory tests, test case management, and lab management) are available for Premium edition users as well. I haven't had a chance to play with these much yet; possibly I'll do a follow-up if and when I do.

In the mean time, my real motivation in downloading VS11 was to finally start posting about async and await in C#. I've been playing with the Async CTP for months now, but wanted to wait until it was part of an actual product before I did any serious research into it. Look for some asynchronous stuff in the near future.

0 comments: