ReSharper vs CodeRush + Refactor Pro

I have been playing with JetBrains ReSharper (version 4.1) and DevExpress CodeRush + Refactor! Pro (version 3.2.2) lately. I wanted to decide on which one to go with. Here are some notes -

R# = ReSharper
CodeRush = CodeRush + Refactor! Pro

  • R# seems to be better for refactoring, because it does not assume that I follow a rigid work flow when writing code. For example, I don’t always decide on the class hierarchies upfront. I do discover them as I write code. So, when I discover that I need to extract a base class from the class I am working on, I can do so with R#. I couldn’t find a way to do extract a base/super class with CodeRush.
  • In R#, I can create an overloaded constructor using “Change Signature” refactoring (Ctrl+R, S). I couldn’t find a way to do this in CodeRush. CodeRush does allow me to create overloaded methods.

However, comparisons that only focus on how many refactorings each tool can do are not very important to me. After all, it should be easy for the individual missing refactorings to be implemented in the subsequent releases of these tools. I want to know which one is a better investment in the long run. The investment is not just a couple of hundred dollars, it is going to be an investment of time too.

  • R# “finds” Types as you try to use them and adds references and “using” directives from other projects in your solution. You will not believe how useful this is! You don’t have to interrupt your train of thought to go add references and “using” directives. CodeRush doesn’t do that.
  • I found R# “Create From Usage” feature incredibly useful with TDD. This feature will be available in Visual Studio 2010. They are calling it “Consume-First Development”.
  • R# has keyboard shortcuts for individual refactorings. All refactorings are accessible from ALT+ENTER or ALT+R. Again, R# helps you keep focused on the code you are writing.  In CodeRush, individual refactorings don’t have keyboard shortcuts.
  • R# allows me to specify exactly what to include when doing ExtractXXX refactorings. CodeRush doesn’t.
  • R# seems to know what I want to do. For example, when I discover that an existing class would be a good starting point to write the class I am thinking about and copy-paste the class and attempt to rename it, CodeRush renames both classes. R# renames the one you intend to rename.
  • R# introduces much less friction when running unit tests. It is possible to add unit-testing add-ins to Visual Studio and access similar functionality, but the way unit-testing is integrated into R#, it is much more conducive to TDD.
  • Collapse a class region. Now try to do a refactoring on this class, like “Rename file to match type” etc. In CodeRush, you will not be able to do it because the three-dot glyph will not be displayed when the class is collapsed.
  • CodeRush keeps getting in my way by automatically writing over as I type. It expands its “smart templates” when you press space. Guess what! That is how I separate words in my sentences – by pressing space. It gets quite annoying. I wish I could turn it off.

As you have probably guessed by now, I think ReSharper is a better fit for me.

Here is a list of some other comparisons, covering aspects and features of these products I haven’t mentioned here that might be important to you. Some of these concluded in favor of CodeRush. Keep in mind that some of the following articles are a couple of years old.

Related posts

This entry was posted in code, tips and tagged , , , , , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

6 Comments

  1. Posted February 22, 2009 at 9:31 am | Permalink

    Which version of Coderush/RefactorPro were you using? (Latest is 3.2.3)

    RefactorPro doesn’t have different keys for each refactoring… but it does have only a single key for al refactorings using context sensitivity to determine which might apply to a given situation. Thus all refactorings are available form a single keystroke.

    I have not used “Create From usage” but from your description it sounds like “Declare method”

    templates in Coderush expand based on particular combinations of characters followed by the primary activation key(defaults to space). What combinations are getting in your way… I’ll bet many are problems with variable naming like ‘dr’ and ‘ds’. coderush will effectively penalise you for choosing poor variable names as it reuses those combinations to imply the expansion of typically much more useful code.

    You CAN of course disable any Template that you find gets in your way. In fact If you navigate to DevExpress\Options… Editor\Templates… you will find that coderush has located and Highlighted the last template you used. sO it will be a simple matter to disable the right one :)

    But you don’t have to go that far… you could simply change the associated expansion key to the alternate (Defaults to Alt-Space)

  2. Posted February 25, 2009 at 11:49 am | Permalink

    Hi Tewari,

    It sounds like you didn’t go very deep into CodeRush. A few points, in addition to those Rory mentioned…

    1. You *can* create overloads of constructors in CodeRush. Just by place the caret on the constructor and press the CodeRush/Refactor! key (Ctrl-`) and then choose “Create Overload”. These are the same steps you perform when you want to overload methods (or use any other refactoring or TDD create from usage feature).

    2. CodeRush *does* add namespace imports automatically when you use templates to declare members, types, and variables, which you should be doing if you want to really maximize your efficiency. You can see what templates are available at any time as you work by bringing up the CodeRush training window (DevExpress | Tool windows | CodeRush).

    3. CodeRush includes smart/powerful create from usage TDD features, including many that are more intelligent than those shipping with ReSharper. Just place the caret on the undeclared code reference and press the CodeRush/Refactor! key (Ctrl-`) and then choose the declaration you want. Some examples are here:

    http://community.devexpress.com/blogs/markmiller/archive/2008/10/27/announcing-coderush-express-for-c.aspx

    BTW, that link above is to an announcement of CodeRush Xpress, a free product that contains a number of hand-picked features from CodeRush, including many powerful Declaration From Usage features. Did I mention that product is free?

    4. Refactor! Pro ships a few disabled shortcuts for refactorings, namely F2 for Rename. You can enable this or set up a shortcut for any refactoring you want using the IDE\Shortcuts options page. However I think you’ll find it much easier to remember one shortcut as opposed to 30.

    And finally, I don’t understand this:

    “R# allows me to specify exactly what to include when doing ExtractXXX refactorings. CodeRush doesn’t. ”

    I don’t think you’re talking about what code to include, because Refactor! Pro certainly allows you to do this. And based on what I’ve seen, CodeRush’s extract method is as intelligent and capable as ReSharper’s if not more so, so the discrepancy you’re mention doesn’t appear to make sense. If you want to reach me directly to elaborate, it’s markm at the devexpress domain.

  3. Posted March 1, 2009 at 12:22 pm | Permalink

    @Mark: Here is another CodeRush bug. Or may be it is a “feature”, which I can disable or customize from an options dialog ;) -

    Create a new WinForms project in Visual Studio. Make sure it compiles. Press F7 to open the code window of the main screen. Highlight the namespace “WindowsApplication1″ and press [Ctrl+`] and select “Rename”. Change the name to “MyCompany.CoolApp”. Try to compile again. It will not compile.

    So much for not going deep enough :D !

    1. Here is a video of my attempt to create an overload of a constructor – http://screencast.com/t/40ThV3xP4Bx . Your suggestion didn’t work.

    2. CodeRush does not add references to “My” projects and namespaces, even if I use templates. Try it for yourself – create two projects in an empty solution – name the first one app.controller and the other one app.service. Declare a class in one project (app.service) and try to use it from the other one. … How did it go ? … Now try it with Resharper.

    3. CodeRush does have a lot of very useful and interesting features, including many that helps in TDD. The difference is that it all “flows” much better in Resharper.

    4. The point is not about how many I can remember. Visual Studio itself has hundreds of keyboard shortcuts. There are over 400 listed here : http://www.dev102.com/vs-cheatsheet/. The point is that for those who use them, they are much more fluent and unobstructive. And Resharper seems to have very well thought out keyboard shortcuts.

    5. When I extract an interface, ReSharper gives me these options :
    http://www.jetbrains.com/resharper/documentation/help20/Refactoring/extractinterface.html.
    It allows me to choose the members to be included in the extracted interface. CodeRush does not give me any options. It includes all (public) members of the class.

  4. Posted March 1, 2009 at 12:37 pm | Permalink

    @Rory :

    1. I am not referring to the one or two letter variable names that get expanded and get in my way. CodeRush seems to want to “help” me when I don’t want/need it. Everytime it happens, I get distracted and loose my place. I will try to post some screen captures to substantiate my comment.

    2. If I change the primary expansion key from [Space] to, say, [Ctrl+Space], the only way to expand the templates is to remember each one of them, because CodeRush does not give me any other way to “lookup” what is available to me as I write code. Well, actually I can also keep the training window open and keep referring to it, but that is not efficient at all.

  5. Posted September 18, 2009 at 10:49 am | Permalink

    I think that on a different level R# also shines through, if you get into the ability to template code cleanups it makes it really easy for a lead dev to keep the code base nicely formatted and streamlined. I have taken to running a code cleanup before doing a major build. This means I can spend less time being a format Nazi and more time on the design of the application.

    Also when coding I would hate to have to go back to using the built in VS Intellisense, that for me is the deal maker, I think R# is well worth the money just for that.

    I still have some 10% discount coupons and extended trials for ReSharper 4.5 for anyone that is interested see here for details:

    http://web2asp.net/2009/09/resharper-discount-and-extended-trial.html

  6. BhaaL
    Posted October 5, 2009 at 6:55 am | Permalink

    Hi, I just came across this post and feel like I have to “protect” CodeRush (or better: CodeRushX in particular which I use) a bit there:

    “Create a new WinForms project in Visual Studio. Make sure it compiles. Press F7 to open the code window of the main screen. Highlight the namespace “WindowsApplication1″ and press [Ctrl+`] and select “Rename”. Change the name to “MyCompany.CoolApp”. Try to compile again. It will not compile.”
    This calls the default refactoring from Visual Studio (Right-click, Refactor > Rename…) – and yes, this one is broken as soon as you try to include multiple levels of Namespaces with your refactoring.
    The same applies to “Extract Interface” which only calls the VS built-in refactoring (which also allows for public members to be selected).

    From practise (and a few colleagues) I know that R# is a powerful tool, but IMO it is a bit too overloaded. Having a hotkey for each refactoring can be neat, but this can also be overcomplicating things. CRX has a single hotkey that shows only applicable refactorings to the current content.
    My colleagues also rant that it slows down their VS, which might be partly true, but that might aswell be a result of their general resource-wasting way of using their PCs.
    My Tool of choice is still CodeRushX.

    - BhaaL

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>