#Google Analytic Tracker

Pages

Sep 8, 2007

In Love with ReSharper Again

 

It was awhile ago that I had given up on using ReSharper 2.5. Mostly it was due to its memory usage and performance.  I can't really blame ReSharper developers. This is party because the files and classes that I work with have over 1000 LOC (i.e. an indication of bad programming design).

However, after begging asking for more RAM from my team lead, I finally upgraded my computer to 3GB of RAM. In fact, my company was nice enough to pay for a license of ReSharper 3.0, C# version. Now I am back on more refactoring and making my code nice and clean.

Features that I like the most

Usage Search and Go to

Simple Visual Studio reference search is just isn't enough. Resharper provides many advance search functions to help you navigate and search your codes. For example. Shift + F12 bring you a list of references of your selected type, which can be sorted by projects, files, or namespaces. Alt + Home to jump to the type Base class, and Alt + End list all the Inheritor that you can go to.

Navigation is very important for me to analysis the unfamiliar code.

Importantly, Shift + Alt + F11, which highlight usage of your selected Type or Variable, which is similar to the Google search highlight, but it is search by highlight by usage, not text.

Refactoring

A powerful feature that ReSharper provides is Refactoring. Refactoring is a term that describes modifying the code without change its functionality. The goal of refactoring is to make the code easier to read, maintain, understand, and extent its function.

For example, using the "Move" refactoring function, I can move a class from one namespace to another namespace with a couple of clicks. Resharper will update the usages references for the rest of the code, so that you don't have to update them manually.

Code Correctness Check

The most attractive feature ReSharper has is that it constantly checks if your code is correct. If you are missing a variables, incorrectly passing parameter in different type, ReSharper would highlight the error for you, or warn you. So that you don't have to "try" compile your code to find out and fix your compiling error.

Other Features

Other Features like code completion, Resharper NUnit GUI, Live Templates are very useful.

Performance, Performance and Performance...

With 3 GB of RAM, I haven't encountered much performance issue as before. However, ReSharper still causes issue when I do the following:

  1. Dynamically generating a very large XML file - In my solution project, there is XML file that we store all the hardcoded string. The file is a couple thousand line of code. If you have this file opened, and use another program update its content, ReSharper would take a long time to parse.

    It appears that it would be faster for ReSharper to re-analysis the file instead of trying to updates its in-memory code.
  2. Renaming is slower than VS's Renaming function. If you have a type that is used in many places, using VS's Renaming is actually faster than using ReSharper. I am guessing Resharper has to updates its in-memory code by looping though code DOM, while VS simply find and replace using its reference search.
  3. Memory usage is high - even with 3GB of RAM, my devenv.exe still used up to 600MB (plus an other 600MB of Virtual Memroy).
  4. Get latest Visual Source Safe may causes Visual Studio to hang for awhile because ReSharper will reanalysis the code.

However, these performance issues are trade-off in the end, because ReSharper provides you instant update of the your code status.

I have been Trying to Convert Others

When I introduce this tool to my colleagues when I started working in the my company, I thought I bought a tool that would help them a lot. However, because of its performance, everyone of them uninstalled it.  I

I have tried to get them using ReSharping again after our computer is upgraded, but they still resisted. This tells me even ReSharper is a great product, first impression is very important. I did convert a new developer to use ReSharper :)

3.0 Improvements from Resharper 2.5

...that I experience

One thing I notice is that ReSharper is much more responsive. In the past, typing code while while Resharper is analysis code is painful and slow.  However, with 3.0, it seems like ReSharper stop analyzing while I type, which is much better.

I have encounter way less exception compare to 2.5. In the past, whenever I encounter an exception, ReSharper was bounded not going to work.

Conclusion

Resharper is by far the most intelligent tool that increase coding productive. I recommend C#, or VB developers should give it a try. Of course, it will help if you have more RAM in your computer.

BuzzNet tags: ,