CodeRush xPress – worth a try?


Now that I’m on holiday for a week, I have time to actually do something different like… er… coding! 😉 So, I noticed that CodeRush are offering a free version of their refactoring tool (and then remembered hearing about this last year anyway…) and thought “let’s give it a try”. I’ve only had a brief play around with it – what it seems to offer is primarily some extra refactoring options to those offered “out-of-the-box” by Visual Studio, but I’ve actually been quite impressed by it.

I think it differs from ReSharper in that RS seemed to add lots of other stuff to the VS shell, whereas CodeRush offers extra refactoring macros and that’s it – which I actually like, as that’s really all that I’m interested in at the moment.

I’ve watched a couple of the videos on their website – there are some nice features that it comes with; here are some of the ones that I remember: –

Navigating within phrases based on camel casing

Imagine you had a method called MyMethodWhichUsesCamelCasing. If you leave the caret to the left of the phrase, hitting ALT+RightArrow will move to each word based on the capitalisation.

Auto-created local from method

You can use this to easily create a variable as the result of a method call: –

image

Press the CodeRush key (on my machine, that’s CTRL + ‘ by default) and you get this (the tooltip shows a preview of what the code will become):

image

Saves you a few seconds, many times a day 🙂 If you choose “implicit” from the pop-up menu, it will do it as var instead of string.

You can even do this for types which don’t yet exist. Neat.

image

Create new class

Creates a new class from a type that doesn’t yet exist…

image

This generates a new class for you based on the name of that type, plus a constructor. Again, nothing groundbreaking, but saves you time.

Create a field from a name

image

image

 

image

Notice all the other options e.g. a property, enum etc. etc. – big time saver.

Automatically use String.Format

image

image

 

Find references

Here’s a really nice one I found – hit TAB on any identifier to move between them:

image

Declare near usage

Another good one – one which actually statistically has been proven to improve code readability and reliability – is to declare your variables only when you use them. So in the example above, it moves the declaration just above the ToString() call:

image

Thoughts

Not bad 🙂 CodeRush Express is free as well – might be worth giving it a try? My thought is that for a day or so you’ll probably find coding a bit slower but if you invest the time in learning how to use this, it’ll save you a LOT of time with not too much time invested… but you’ll need to spend the time looking into what it can do, otherwise you simply won’t make use of it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s