There are so many new features introduced in the VS 2010. Each individual will have
their own liking and style of coding, having said that all new feature introduced
with the VS 2010 may not be equally useful to each one of us.
Below are some of the new features that I think are most useful, in no particular
1. Block selection
The block selection of the text in the code edition has been enhanced in the VS
2010. In new editor you can select the block and insert the new text on every selected
Let me explain what I am saying, for example let us say we have bunch of variable
declaration like below
At some point of time, let say you feeel that all the above listed variables needs
to be declared as public instead of private.
All you need to do is block select the private key words on different lines, by
holding Alt key down and moving the mouse as shown below. While you have selected
the private keyword on all the lines, type "public", you are done all private are
changed to public.
2. Call Hierarchy
I found that call Hierarchy is a good feature, especially when you are debugging
some other's code. This feature allows you to find calls that are going out
and coming into a method. The nearest feature in the VS 2008 would be
find all references.
To see the call hierarchy select the method name and press
Ctrl+K , Ctrl+T
or right click on the method name and select "View Call Hierarchy".
It will show you a Call hierarchy window as below.
In VS 2010 code editor we can zoom in and zoom out, by holding down
the Ctrl and rolling the mouse roller.
This is quite usefull feature when you are presenting your code sample. Otherwise
often than not we end up increasing font size of the code editor during demo session.
4. Generate From usage
One another feature that is enhanced or improved
is, generate from usage features. Till VS 2008 we had the ability where you can
generate the stubs for a method that you type in your code.
For e.g if you have class MyClass
that do not have a method by name MyMethod .
If you realize while coding that you need a method called MyMethod
on MyClass, you can go ahead and type is as if that method is already
available, like below.
A small blue rectangle appears at the left bottom of the method name
as shown above. If you mouse over the blue rectangle you will be presented with
an option to generate the method stubs as below.
By choosing that option you can generate the stub for MyMethod on class="SpellE">MyClass without leaving your current code window, meaning
less distraction while you are coding.
In VS 2010 this feature is taken to one level up where
you have ability to generate the stubs for class itself.
Also it is possible to generate stubs
for Property, field and a new type (enum, interface and
struct) in addition to method stub.
Below shown are the options
Generating class or type stub\
Generation field or property stub
Note: You can also use the short cut Ctrl + . instead
of mouse overring the blue rectagle
Very much informative and useful.