.Net Tips and Tricks

Blog archive

Supporting Test First Development with CodeRush

CodeRush doesn't claim to have as many new features in its Visual Studio 2010 version as JetBrain's ReSharper did in their new version. And I'm not sure that's a bad thing: The product is actually packed with features. In my first review of CodeRush back in 2009, I noted that I had a hard time mentally managing all the key stroke combinations used to access all the functionality in the package.

I may have been overreacting. With CodeRush installed, Ctrl_+ often activates the feature you want (based on where your cursor is) or brings up a context sensitive menu of available actions. For instance, while I'm a big fan of Test Driven Development, I find the "generate by usage" feature of Visual Studio 2010 that supports "test first" development awkward to use. To use the native Visual Studio feature I have to type in a statement that uses a property that I haven't written yet, move my mouse back to the SmartTag at the start of the property name, click the dropdown arrow, and select the option to create the property... and I always get an auto-implemented property. I've got nothing against auto-implemented properties, but sometimes I know that I'll need a backing field.

With CodeRush, I type in the property name, press Ctl_+ (you can reassign this key if you want), and get a drop down menu right under the cursor that I can arrow down through for the mouse. Furthermore, this menu gives me choices: an auto-implemented property or a "real" property complete with a backing field. CodeRush then lets me choose where the property is to go in my code. And my hands never have to leave the keyboard!

As far as I'm concerned this is the way that the feature should have been implemented.

Posted by Peter Vogel on 08/26/2010 at 7:59 AM


comments powered by Disqus

Reader Comments:

Sat, Sep 11, 2010 Peter Vogel Canada

I think that I have a deepseated aversion to pressing the Escape key. I have a primal fear that anything I've got on the screen when I press Escape will go away. I should either get over it or remap the key (or go back to using ReSharper (grin)).

Tue, Sep 7, 2010 Mark Miller DevExpress

Peter, when you use CodeRush's consume-first declaration features, don't forget that you can press Escape to get back to where you started -- useful if you want to fill out the generated declarations with some meaningful code before returning to the consuming code. This Escape key jump-back also works with refactorings that take you away from the starting location.

Thu, Sep 2, 2010 Rory Becker

Thanks very much for your review Peter. It's always good to see our products mentioned in such a positive manner. One thing we're very passionate about at DevExpress, is the continual improvement of our products. We welcome feedback of all kinds. Suggestions, questions etc can be posted to our Support Center (http://www.devexpress.com/Support/Center/) We're also quite happy to talk to people directly. For example, I'm a CodeRush Community Evangelist and you can reach me by email @ roryb@devexpress.com

Fri, Aug 27, 2010 Peter Vogel Canada

The problem with me (at my advancing age) is that there is a hard limit to the number of hot key combinations that I can remember. The nice thing about the ctrl+ combination is that it opens a whole bunch of things in CodeRush. As I've noted in earlier posts, people with better memories than me will have different reactions to code key issues than I do. And I also still like the option to choose between an autoimplemented property or one with a backing field (actually, since CodeRush is writing the code, I pretty much always take the backing field implementation).

Thu, Aug 26, 2010 Sean

Ctrl-Alt-F10 will automatically pop open the SmartTag menu too. No need to leave the keyboard.

Add Your Comments Now:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above