Why I like ReSharper

by Erik Lane 7. June 2005 16:18
I posted last week about how to get my employer to purchase a license for ReSharperYex called me on it and wanted some explanations why I liked it or didn't like it.   Sean Chase has some and here are some of my own.  There is still more things to ReSharper than what I'm posting about here. But, I can say that after using it for a month these are the key things that I use daily.  I hope some of this is helpful and useful.  Sorry it's a long post but this was put together over a few days when I didn't really have time to put it together for a blog post.  So I did a little at a time on the side until I could get it all together and posted.  The text in blue are things that I consider time savers and help me be more productive.

Syntax Highlighting:
Adds highlighting for fields, local variables, types, and more:

Syntax Highlighting
You can configure highlighting settings in the standard VS.NET highlighting setup.

Highlights variables that are never used. This is very handy when working on "group" code when you're not sure if removing a variable will blow anything up.  Cleaner code.

Unused variable

Bracket Matching: You notice that the brackets for the foreach block are highlighted. That happens for each code block whether it's a foreach loop or an if statement. This is helpful for nested parentheses too since it can get confusing at times.  As you move to a parenthesis its matching parenthesis is highlighted. Also in this screenie is a an example where the beginning of the foreach loop is outside of the code window. The cool little tool tip pops up...I like that!

Bracket Matching

Code Refactoring:

Renaming:

Using the ReSharper rename will automatically correct all references to that item in the code. It's not just a text match.

If you rename a Namespace all Namespaces, Using directives, and qualified names of types are renamed. If you rename a Type all Using directives, and qualified names of types are renamed. If you rename a Method all calls to the method and overridings/implementations of the method in subclasses are renamed.  There have been times where I've not renamed a method because I didn't want to track down all of the uses and possibly miss one.  If you rename a field all uses of the field (both read and write) are renamed.

Encapsulate Field:
If you've ever spent time creating a class that has more than a few properties you know who much of a beating it can be just to type everything. Here, you type the field and then right-click& bam!  Less time typing getters and setters.  Or if you choose convert your current properties to a pair of Get/Set methods.

Encapsulate a field

  Resulting field

Convert Property to Method:

Convert Property to Method

Resulting method

Code Analysis bar (not official name but what I call it). It's a handy vertical bar on the right-hand side of the code window. At the top it's green if good, orange if there are warnings, and red if there are errors. What dictates a warning/error is configurable too. As you move down the vertical bar there is a smaller indicator where the warning or/error is. Hover over it and it gives you the message.  Less time attempting to compile/recompile.

Green, Orange, Red Analysis Bar

Auto complete: This another favorite of mine. A simple Alt-Enter puts the needed using statement for me at the top of the code. The second screenie shows where I just typed in "Sql" and pressed ctl-alt-space and it gave me a full list...notice that the System.Data.SqlClient using statement is not at the top, yet I can still select that class. No more searching for the right namespace if I know the beginning of the class name. When I select the class it will insert the using statement too.

Auto complete

Code Reformatting:

I'll be honest, this good enough for me to almost spend the $150 of my own money (may have to anyway). In the ReSharper options I can design my own coding style standards and with a simple right-click ReSharper will reformat my code (highlighted section, class file, or complete project) to the settings I picked. I've heard that  a good use could be where a company can come up with their own coding style/standards and each developer and still code how it works for them. When the code is ready for check-in just reformat the code to the company settings. Either way I like having it look over my shoulder for me to keep up a personal standard. Saves me time in not having to re-review my own code for the standards and provides cleaner code.

Code Reformatting

 

There is really only one thing that I currently don't like about ReSharper.  The loading of a project is slower since Resharper examines all of the files and assemblies during the load process.  It's not too bad after the first go but it still bothers me enough to mention it.

Tags:

Comments

David Stennett
David Stennett on 6/12/2005 11:35:00 PM

Thanks for the nice review of ReSharper ... I won't comment on what I think you missed Wink .... however, I will say in regards to the slow load up process (where ReSharper is caching your project for the first time), this will be changed in ReSharper 2.0, so you can just jump right into your project.  If you haven't seen the ReSharper 2.0 plan already, check it:

www.jetbrains.net/.../ReSharper+2.0+Plan" rel="nofollow">www.jetbrains.net/.../ReSharper+2.0+Plan">www.jetbrains.net/.../ReSharper+2.0+Plan" rel="nofollow">www.jetbrains.net/.../ReSharper+2.0+Plan

All the best,

David Stennett
JetBrains, Inc.

eriklane
eriklane United States on 6/13/2005 12:59:00 AM

David,

Thanks for the notes.  Yes, I've seen the 2.0 plan and makes me like it even more.  Smile  I'm sure I've missed a lot of the more complex items that ReSharper can make easier and/or better.  These are just the things that, within the last month, I've grown accustomed to having at my finger tips and would expect it to grow as I use the tool.

Comments are closed