Pages

Showing posts with label Tools. Show all posts
Showing posts with label Tools. Show all posts

Thursday, 22 October 2009

DevExpress CodeRush and Refactor! Pro Review

I've been taking a look at this 2-product package from DevExpress over the last couple of weeks. These are my findings...

Pros
  • Adding cyclomatic complexity numbers to the left-hand margin of members was very nice. This gives you immediate awareness of whether your method needs to be refactored.
  • The Metrics window allows you to see any of the 8 measures for an entire class and then double click a member to dig down into the code. This I liked a lot.
  • Adding contracts to methods was reasonable.
  • Automatically greying out unused or unnecessary code (including namespaces, contexts and members) was very nice.
  • Inline ability to suppress suggestions for a varying scope was good.
  • Pull Member up. Lists parent classes to move a member to.
  • "Introduce a using statement" (to an IDisposable object) worked extremely well.
Cons
  • Initial thoughts are that it hides poorly written code and, thus, detracts from Craftsmanship.
  • I removed all the vertical connecting lines - far too messy.
  • The suggestion to make some variables inline was wrong. It makes the code harder to understand and, anyway, the compiler will do it.
  • The jump / break / return pointers are interesting and pretty, but it simply validates overly complicated code.
  • The suggestion to replacing objectName + ".sql" with string.Format("{0}.sql", objectName) is not necessary. Strings are, indeed, immutable; but you can concatenate them efficiently during the instantiation.
  • Suggestions to remove this. from variables - I didn't like that. I don't qualify methods with this, but I do for properties and fields. It would have been nice to separate the features.
  • I removed the Region Painting functions as it was less clear than VS's inbuilt features.
  • Disabled the Structural Highlighting. If you need an icon next to the word private to tell you that it's private then you really shouldn't be a developer!
  • Circular suggestions. Having converted a newed-up object to use Initialisers it then changed the suggestion to decompose it!
Wish List
  • A prompt to automatically end a #region. including the text e.g. #endregion Constructors.
  • Context-sensitive help in the Options dialog please.
  • Ability to add multiple metrics rather than just Cyclomatic Complexity or Line Count etc. to the left-hand margin of classes.
  • In the Option dialog identification of Level in the tree view would help.
  • A refactoring routine to create the protected On() method for events.
Conclusions? Well, overall, not bad at all. I thought I wouldn't like the interaction and the perceived lack of control; but it was actually pretty easy to use. It does take a while to learn. You just have to get stuck into some code and see what it suggests. Soon you'll find yourself wondering whether it can do xyz for you - normally it can. I, personally, will be keeping it.

My biggest fear is that too many of the features are there just to mask bad code design.