A couple of quick things that you’re going to like when you start using Visual Studio 2010…
Visual Token Recognition
This is a form of syntax highlighting that exposes variable use throughout the current class file. This is actually a significant boost when you’re trying to assess the potential impact of a refactoring. You can place your cursor on the member definition and every instance of the token will be highlighted throughout your file.
Even cooler is that it works not just on variables but also on other tokens, such as methods and properties:
You may also notice from the above shot that your cursor doesn’t have to be in the method/property/variable declaration; in fact, if you cursor into any member usage, all other instances are lit up. Brilliant.
Collapsible Section Highlighting
Here’s another visual enhancement (it is subtle, so it will be hard to see on a non-contrasty display):
Okay…artiste, I am not. But I had to draw in the cursor where it was hovering when I got the block of code to light up. There is a light-grey highlight behind the entire collapsible section.
More Ways to Learn the Code
If you’ve ever been assigned a defect on a system that you are new to or haven’t worked on in a while, it doesn’t really matter how experienced a developer you are, you’d probably enjoy a bit of help. The above enhancements are good tools for that.
So are these: Generate Sequence Diagram and View Call Hierarchy.
Both of these features are available from the right-context menu of the code editor in Visual Studio 2010.
The call hierarchy is very similar to the debug experience in previous versions of Visual Studio in that you can see where the code walks from where you’ve queried. This is a bit different from the debug version, where your hierarchy are inferred from the current execution point.
The Generate Sequence Diagram feature is a great aid in discovery as well and a welcome addition. If an SD is one of your deliverables, I can assure you that it’s just as slick as the View Class Diagram feature from previous versions. Though they can get quite complex if you fully include all options, they can also be very descriptive – including code snippets – and will give any viewer a good idea of the execution path for the areas of your software you’ve included.
Several external tools have been created over the years, and some of us have had to slog away in things like Visio before (which is where I did my assignments in my UML courses. Echk.)
If You Don’t Use These, It’s Only Because You Don’t Use Them YET.
Right from the start Visual Studio looks and feels like it will provide developer productivity improvements. While productivity is usually a seller for management, these types of improvements are actually good for developers and equip us to better navigate our code, legacy code and code that you might fear. Because the IDE allows us to target different versions of the .Net Framework, we can also leverage these gains on older projects.