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.

13 comments:

Rory said...

Regarding "Lack of proper keyboard support"

I wonder what you mean. Perhaps it's possible that our updated compatibility plugin might serve your needs -> http://tinyurl.com/35kpqwf

Ruben Bartelink said...

Re: member selection, is this any use? http://rorybecker.blogspot.com/2010/02/enhance-quicknav-coderush-or-coderush.html

(I'd like it OOTB too though)

Dont get your single key as a + for R# - if anything CR is more single key?

@rbartelink

Anonymous said...

In there defense, Devexpress expects you to drink the entire bottle of koolaid (total buy in). Once you get assimilated by the borg, you will find that the experience is not quite so bad and if you ever left, It will be next to imposible to live without it.

Thanks for the balanced opinion.

Rory said...

The Duplicate Line feature duplicates a line of code based on pattern matching with rules and the emitting the duplicate wrapped in fields where appropriate. Try duplicating a variable declaration.

If you'd like to turn on whole line matching as well, see DevExpress\Options ... Editor\Auto Complete\Duplicate Line Setup and you can turn this on from there.

Mike said...

>>I’ve become very dependent of it.
It was never wise and will never be to use such IDE extensions ... this is fragile.

Peter Ĺ ulek said...

Good post. I also prefer R# over other similar product(s).

Rory said...

@Mike Technically you don't need to use Visual Studio (or any other IDE). People do because it provides a additional level of productivity.

If it is fragile, then this is true only to the same degree as using Visual Studio, but I don't see people giving it up in droves.

Javafun said...

I think there is one more great feature R# F12 will automatically download the source code of .NET framework, but not CodeRush/Code Refactor Pro

Anonymous said...

I find each these productivity enhancements very personal, so there is no one right answer. I use codeRush Express because it's free ;)

I tried teleriks new Justcode for a bit and I found it quite good, I'd love to hear your opinion on it: http://www.telerik.com/products/justcode.aspx

Hadi Hariri said...

Hi Dennis,

Thanks for the feedback regarding ReSharper. Could I ask you to possible contact me (hadi at jetbrains dot com) or directly file steps to reproduce some of the things you've pointed out?

In particular:

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

The dialog boxes are in fact non-modal to not prohibit you from looking at code, but I'd also be interested in the workflow you follow that makes you lose focus on them, to see what we can do to try and improve or prevent that.

Once again, thanks so much for the feedback.

Hadi Hariri said...

Also, I'm sure you're aware, but just in case, we do have a 3rd party plug-in for spell checking:

http://www.jetbrains.com/resharper/plugins/index.jsp

as well as other plug-ins via http://resharperpowertoys.codeplex.com

Thanks.

Dennis van der Stelt said...

Pretty funny that you pointed out two major flaws during your unit testing presentation in Leiden for DotNed last night.

First you got a TON of dialog boxes which was very annoying. Secondly when you tried to undo the operation, the class name got its original name back, but the filename still had the new name.

#fail

@dyardy said...

I have tried and used both however in the end I like the speed and focus on making code generation easier with CodeRush. Their templating system makes it very easy to add new templates as well as modify the delivered templates. Love CodeRush!

I do however see how different programming styles will make individuals lean to one or the other. Really comes down to personal choice but EVERYONE should try out both.