Resharper, CodeRush and Other VS Tools

Jeffrey Palermo commented recently on JetBrains' latest TeamCity 1.2 release. Cool, but that was not struck my interest. See, Jeffrey goes on praising Resharper and says that Scott Bellware uses it a lot. So does apparently a lot of other bloggers, from what I read constantly from people on my blogroll.

I must admit I've never used Resharper myself, though it definitely sparks my interest; I'll certainly have to try it out some time. However, I do have both CodeRush and Refactor! from Devexpress. I will say that both are very useful products and in general terms I've always found CodeRush very extensive set of features very impressive. I would certainly recommend either one as a way to improve Visual Studio remarkably to anyone.

That said, I have to admit that I rarely use CodeRush, even though I keep it installed and enable it from time to time. I will also admit that I do this against my will! See, I want to use CodeRush. A lot. But everytime I do, it soon drives me crazy, though more because of my own fault and how I use Visual Studio than because of the tool itself. Here's the deal:

CodeRush has a huge ammount of templates, expansions, formatting rules and a whole bunch of other stuff I haven't even begun to explore yet. Unlike other tools (including quite a bit of the tools inside Visual Studio itself) it is highly keyboard-oriented, meaning most of the stuff is triggered as you type the code and some key combos instead of having to drag the mouse oriented. That's fantastic of itself.

However, the first problem I always run against is that all the default key combinations in CodeRush, particularly those related to code navigation, are made to work well with the default keyboard layout used by Visual Studio (or at least that's my guess). My problem is that I refuse to ctrl-shift-B to compile.

In other words, I'm a big user (and will continue to be for the foreseable future) of the old VC++ 6.0 keyboard bindings. Because of this a lot of the default mappings in CodeRush directly conflict with key combinations already mapped in my Visual Studio key assignments. Normally this wouldn't be a problem given how huge VS key maps are, but unfortunately it steps on quite a number of key combos I use every day a lot of times that do a lot of useful things.

So to be able to use CodeRush one of the first things I have to do is go around deactivating (or remapping) some of the default key assignments, which, given the huge set of mappings in it is always a challenge.

My second issue with CodeRush is that I'm anal about code formatting (hence my recent suggestion about allowing per-solution settings), and as much as possible I try to keep to my code formatting rules. I always keep Visual Studio to format my code just how I like it, by keeping a copy of my favourite settings exported around as a vssettings file and importing it as soon as I install VS. And to be honest, the code formatting editor features in C# has improved a lot and for 99% of the cases they work just fine for me.

Again, CodeRush has a lot of code expansions, which are great! Except they also output code formatted just as they were configured originally. And yes, they conflict with my own configuration. So, it's either manually adjust the default templates in CodeRush (a monumental task by itself), or try to then manually format the code after the fact, which kinda defeats the purpose in the first place. And no, I refuse to just let the code in whatever way it was thrown out.

I could live with the two issues above and spent the time necessary to configure CodeRush exactly how I liked it in such a way that it doesn't cause me pain. I'm willing to spend the time to configure it (as it would save me time in the end by allowing me to use the features it offers), but I haven't done it. Why? Because so far, I haven't found a way to export all my CodeRush settings so that I could reimport them everytime I repave my machine (which is fairly often). And doing that more than once is just not something I'm wanting to do. Hopefully that last issue is there and I just haven't found it!

How does Resharper fare on these three issues?

Comments (3)

Ilya RyzhenkovJanuary 27th, 2007 at 4:59 am

ReSharper templates, code styles and other settings can be exported to XML files and imported back. It can even be set up to store (some) settings on network drive, which is very useful for team setup. Also, ReSharper automatically reformats inserted templates according to current coding style. I have to admit, that CodeRush has much more templates, but personally I find ReSharper’s code generation facilities enough for every day work.
Default shortcuts are not that good in ReSharper and sometimes conflicts with VS shortcuts. However, this needs to only be configured once, as you can export VS key bindings along with your configuration.
Note, that ReSharper has live error and warning highlighting for C#, which CodeRush and Refactor Pro! don’t have. That is, you will use ReSharper every development minute, even without templates and other code generation features, even without ever using ReSharper commands. Actually, I’m so used to Alt-ENTER quick fixes and context actions, that I tend to use them in Microsoft Word when it highlights spelling error :)

Tomas RestrepoJanuary 27th, 2007 at 5:42 am

Ilya,
Thanks, I appreciate the comments. The fact that you can export and import your resharper configuration is a big plus in my opinion! As for the number of templates, I don’t really have a use for that many templates, I have terrible memory and can never remember more than just a few anyway! I’m giving Resharper a trial run and see how I like it!

Mark MillerFebruary 12th, 2007 at 2:19 pm

Hi Tomas,
My apologies for the delayed response. I just now ran into your blog post.
Can you let me know what shortcut conflicts you’re encountering? You can email me at markm at devexpress (dot com).
To export settings, just XCopy this folder:
%userprofile%\Application Data\CodeRush for VS .NET\1.1\Settings
With regard to formatting, CodeRush reformats all code generated by calling the format command of the active language service. So if the format is different from what you desire, just change the Visual Studio formatting options for the language you’re working with. You can test VS formatting options by selecting the code you want to format and pressing Ctrl+K,F (that binding should work even with the VC++ shortcut bindings). If Visual Studio doesn’t support a formatting option you want, then you can manually change the template.
With regard to getting more ownership over the product, I highly recommend the CodeRush training window (from the DevExpress menu select Tool Windows, then select CodeRush). This training window reveals the most powerful and appropriate features available as you move through the code, and will help you exploit CodeRush quickly.
Finally, there are training videos for both CodeRush and Refactor! Pro here:
https://www.devexpress.com/CodeRushTraining

Leave a comment

Your comment