Monday, November 29, 2010

ReSharper versus CodeRush through the eyes of a keyboard addict

I've been a very long-time and very happy user of ReSharper, and I’ve become very dependent of it. I wouldn't know what to do with a plain Visual Studio 2010 installation. However, I also heard many great things about the combination of DevExpress's CodeRush and their Refactor! Pro products. Apparently my many tweets about the greatness of R# have attracted some attention, so DevExpress offered me a one-year license to try their products out. To be fair, I did pass this blog post to DevExpress to make sure I was not overlooking something and they've provided me with some great feedback. Nevertheless, this is my personal opinion, even though I've really tried to be as unbiased as possible.

For the comparison I used ReSharper 5.1.1 and CodeRush/Refactor Pro 10.1.7. The development box I tested on was a Sony Viao notebook with 8 GB of memory, a Core i7 CPU (1.73 GHz) and an Intel X2 160GB SSD.

R# versus CodeRush / Refactor Pro!

+

Syntax coloring. Not everybody likes it, but I really think it improves the readability of your code.

+

File Structure window. I use it continuously to make sure all my classes can be read from top to bottom (a la Clean Code).

+

The menus are self-explanatory and include the currently configured shortcut key.

+

Single keystroke for virtually all fixes, improvements and refactoring opportunities.

+

Code Cleanup, will fix naming issues, reformat the layout, and other improvements. Can be applied to the entire solution.

+

Project/Solution-level refactoring features such as fixing up namespaces globally and moving every type into its own source file.

-

Surrounding a statement requires a few more keyboard hits

-

Requires a lot of memory and still has a major performance impact on Visual Studio

-

Doesn't always understand where a custom extension method comes from.

-

R# relies more on dialog boxes to provide the details of some refactoring option, whereas CodeRush relies more on inline editing. Unfortunately, the dialog boxes don't always get focus properly, requiring the mouse to activate it. This also happens when the change causes a file to get checked out. At that point, the TFS dialog box and R#'s are in conflict.

 

CodeRush  / Refactor Pro versus R#

+

Way more refactoring options

+

Way more code generation options requiring only one or two keystrokes

+

It's configuration system is extremely flexible

+

Nice context sensitive help tool window, especially for the single-character code generation templates.

+

Feels a bit snappier than ReSharper

+

Embedding a block of code is nice. Just select a block of code and press one of the keys such c for a try...catch. ReSharper can do this as well but requires more key strokes. In fact, I really love being able to add ( and ) to an expression by selecting het expression and '(' and get it surrounded. Oh Jetbrains, please add that one as well.

+

I like the marker concept which allows you to sprinkle bread crumbs and simply step back to the last edition position or the last marker. Takes a bit of getting used to, especially after using ReSharper since it uses ESC to cancel a refactoring action.

+

If you're into code metrics, you'll love the little icons listing the number of lines and code metric indicators next to it, but I have not really found the need for it.

+

When you just use a particular feature for the first time, it shows you a small non-intrusive dialog explaining what just happens, and giving you the choice to change that behavior.

+

It has a built-in spell checker that highlights words and provides a context menu with alternatives.

+

It can refactor an ordinary statement with one that uses the Parallels library

-

Amount of visual feedback is a bit too much sometimes, but it drops off after a while

-

Overwhelms a bit too much in the beginning

-

Not as well designed for keyboards users as R#

-

No member selection (a la R# CTRL-\)

-

Quick Navigation (CTRL-SHIFT-Q) does not show namespaces, so duplicate items are difficult to differentiate). You can use the CTRL key to get a preview of the highlighted code block, but it's a bit slow sometimes.

-

No Smart Completion such as referring to something that is not part of the namespace or in an unreferenced assembly, both in code, in ASPX and in XAML files. You have to fall back to the CTRL-. VS keyboard option, but that only works when the class is in the same project or part of the references.

-

No refactor option for renaming a namespace based on its location in the source code hierarchy

-

Duplicate Line feature (SHIFT-ENTER) does not duplicate an entire block of code

-

No option to add the opening parentheses when calling a method

 

Conclusion
In general I want a tool like R# or CodeRush to replace and extend the default features of Visual Studio without the need to learn too many new tricks. But most importantly, its keyboard support must be excellent. I want as less keystrokes as possible to get as much work done as possible within the context of the code you're editing. Based on my short experience, it seems that DevExpress has focused on shortening the amount of keystrokes to generate new code and to introduce as many refactoring options as possible. R# on the other hand, excels in keyboard support and improving the overall experience of programming in Visual Studio 2010 without too much interference. As far as I can see, R# biggest problem is their ridiculous memory and performance footprint, whereas DevExpress's primary concern has been to introduce as much features as possible, without looking back at the consistency aspects.

I've really tried to give DevExpress's tools a fair change, but at the end, the inconsistent experience, both on the visual level as well as the lack of proper keyboard support, have forced me to stay with R#. These are more important for me than the many extra refactoring options.