Moving up from CodeRush Xpress to CodeRush

19 December 2008

Considering an upgrade from CodeRush Xpress to the full version of CodeRush? This post is for you. For anyone who needs an overview of features shipping in CodeRush Xpress, see this page on MSDN:

http://msdn.microsoft.com/en-us/vcsharp/dd218053.aspx

The difference, in a nutshell: CodeRush packs in 150 more refactorings, code template technology (think Visual Studio's code snippets on steroids), more coding tools, more visualization tools, more navigation tools, and many more useful features. Additionally the full version of CodeRush also includes support for languages other than C#, like ASP.NET, XAML, Visual Basic, Javascript, and C++. And because the full version of CodeRush is the primary focus of DevExpress' IDE Tools team, the latest greatest features & refactorings will always show up there first.

For clarity, features that are part of CodeRush Xpress appear here in a light red font, followed by a corresponding list of additional features only available in the full version of CodeRush.

Refactorings

CodeRush Xpress includes the following refactorings:

  • Add/Remove Block Delimiters
  • Combine Conditionals (merge nested "If" statements)
  • Compress to Lambda Expression
  • Compress to Ternary Expression
  • Convert to Auto-implemented Property
  • Convert to Initializer (use object/collection initialize when possible)
  • Create Backing Store (converts Auto-implemented Property to standard Property with get and set)
  • Decompose Initializer
  • Decompose Parameter
  • Expand Lambda Expression
  • Expand Ternary Expression
  • Extract Method to Type
  • Flatten Conditional
  • Introduce Local (introduce variable)
  • Inline Delegate
  • Inline Temp (inline variable)
  • Make Explicit
  • Make Implicit
  • Move Type to File
  • Name Anonymous Method
  • Name Anonymous Type
  • Reverse Conditional (invert "if")
  • Split Conditional (split complex "If" statements)
  • Use StringBuilder
  • Use String.Format

The full version of CodeRush includes all of the preceding, plus the following additional refactorings, grouped by category:

ASP.NET

  • Add AssociatedControlID Attribute
  • Add RunAt Attribute
  • Add Validator
  • Convert Color to HEX
  • Convert Color to Named Color
  • Convert Color to RGB
  • Convert to Pixels
  • Convert to Points
  • Convert to Skin
  • Extract ContentPlaceHolder
  • Extract ContentPlaceHolder (and create master page)
  • Extract Script
  • Extract Style (Class)
  • Extract Style (id)
  • Extract UserControl
  • Make ID Unique
  • Merge Styles
  • Move Style Attributes to CSS
  • Move Style Attributes to External CSS
  • Move Style Attributes to Theme
  • Move Style Attributes to Theme (use SkinID)
  • Move to Code-behind
  • Set CssClass
  • Split Style
  • Surround with Update Panel
  • Toggle ViewState

Changing Signatures

  • Create Overload
  • Introduce Parameter Object
  • Make Extension
  • Make Member non-Static
  • Make Member Static
  • Promote to Parameter
  • Reorder Parameters
  • Safe Rename

Conditionals

  • Case to Conditional
  • Compress to Null Coalescing Operation
  • Conditional to Case
  • Expand Null Coalescing Operation
  • Initialize Conditionally

Contracts

  • Add Contract

Dead Code

  • Remove Empty Handler
  • Remove Parameter
  • Remove Private Setter
  • Remove Redundant Call
  • Remove Redundant Conditional
  • Remove Redundant Constructor
  • Remove Redundant Delegate Creation
  • Remove Redundant Destructor
  • Remove Redundant Qualifier
  • Remove Redundant Type Specification

Declaration and Initialization

  • Move Declaration Near Reference
  • Move Initialization to Declaration
  • Remove Assignments to Parameter
  • Split Initialization from Declaration
  • Split Temporary Variable

Expressions

  • Convert to Is Nothing
  • Inline Constant
  • Inline Recent Assignment
  • Inline Result
  • Introduce Constant
  • Introduce Constant (local)
  • Introduce Result Variable
  • Replace with Constant
  • Replace with Local
  • Simplify Expression
  • Use Equality Operator

Formatting

  • Break Apart Arguments
  • Break Apart Parameters
  • Create Multi-variable Declaration
  • Line-up Arguments
  • Line-up Parameters
  • Split Multi-variable Declaration

Interfaces

  • Add to Interface
  • Extract Interface

Loops and Blocks

  • Consolidate Using Statements
  • Create With Statement
  • For to ForEach
  • ForEach to For
  • Inline With Statement
  • Introduce ForEach Action
  • Introduce Using Statement
  • Lock to Try/Finally
  • Split With Statement
  • Using to Try/Finally

Macros (C++)

  • Inline Macro
  • Use Const
  • Use typedef

Moving/Extracting Methods

  • Extract Function (outside of class)
  • Extract Method
  • Extract Property
  • Move Method to Header
  • Move Method to Source File
  • Pull Member Up
  • Replace Temp with Query

Properties and Fields

  • Collapse Accessors
  • Create Setter Method
  • Encapsulate Field
  • Encapsulate Field (read-only)
  • Expand Accessors
  • Introduce Setter Guard Clause
  • Method to Property
  • Property to Method
  • Remove Setter Guard Clause

Renaming

  • Rename (works on local variables, functions, methods, fields, properties, parameters, types, namespaces, namespace aliases, CSS styles, XML/HTML/XAML tags, global variables, and C++ macros)

Resource Files

  • Extract String to Resource
  • Extract String to Resource (replace all)
  • Extract to XAML Resource
  • Extract to XAML Resource (replace all)
  • Extract XML Literal to Resource
  • Replace with XAML Resource

Strings

  • Concatenate Strings
  • Inline Format Item
  • Introduce Format Item
  • Split String
  • Use Environment.NewLine
  • Use IsNullOrEmpty
  • Use String.Compare

Types, Typecasting & Namespace References

  • Boolean to Enum
  • Convert to Built-in Type
  • Convert to System Type
  • Encapsulate Downcast
  • Inline Alias
  • Introduce Alias
  • Introduce Alias (replace all)
  • Move Type to Namespace
  • Optimize Namespace References
  • Remove Type Qualifier
  • Remove Type Qualifier (replace all)
  • Rename File to Match Type
  • Rename Type to Match File
  • Replace with Alias
  • Use Explicit Notation
  • Use Short Notation

Visibility

  • Reduce Visibility
  • Widen Scope
  • Widen Scope (promote constant)
  • Widen Scope (promote to field)

XML, HTML, and XAML

  • Add End Tag
  • Break Apart Attributes
  • Change Tag
  • Extract to XAML Template
  • Line-up Attributes
  • Remove Attribute
  • Remove End Tag
  • Remove Tag
  • Reorder Attributes
  • Surround with Tag

Other CodeRush Features

Clipboard Tools

CodeRush Xpress includes the following clipboard tools:

  • Smart Cut/Copy
  • Paste Replace

The full version of CodeRush includes the clipboard tools listed above, as well as the following additional clipboard tools:

Intelligent Paste

Intelligent paste modifies the text from the clipboard before inserting it into the editor. Here's a sampling of some of the intelligent pastes defined for C#:

Name / Description Sample Clipboard/Paste
Typecast. Converts an "is" test to a typecast myVar is MyClass
(MyClass)myVar
Declaration. Converts a statement that creates a new object into a declaration. myVar = new MyClass();
private MyClass myVar;
Assignment. Converts a relational expression to an assignment. aaa != bbb
aaa = bbb;
Expression. Converts an assignment to an expression when pasted inside parens. aaa = bbb;
aaa == bbb
New Method. Creates a new method declaration from a method call when pasted on an empty line outside a method or property. MyMethod();
public void MyMethod()
{
}

Clipboard History

The Clipboard History tracks up to 64 of your most recent clipboard cut and copy operations, syntax-highlights them using the same colors you use in Visual Studio, and lets you easily paste them into Visual Studio.

ClipboardHistory 

Code Providers

Code Providers make intelligent changes to your code. Just select or place the caret on the code you want to change, and press the CodeRush/Refactor! key.

CodeRush Xpress includes the following code providers to declare elements based on usage:

  • Types

    • Declare Class
    • Declare Delegate
    • Declare Enum
    • Declare Enum Element
    • Declare Interface
    • Declare Struct
  • Members
    • Declare Constructor
    • Declare Event Handler
    • Declare Getter
    • Declare Method
    • Declare Property
    • Declare Property (auto-implemented)
    • Declare Property (with backing field)
    • Declare Setter
  • Variables
    • Declare Field
    • Declare Local
    • Declare Local (implicit)

The full version of CodeRush includes all the declaration features listed above, as well as the following:

  • Add Else Statement
  • Add Missing Constructors
  • Add Setter
  • Create Descendant
  • Create Descendant (with virtual overrides)
  • Create Implementer
  • Create Method Stub
  • Invert Selection
  • Mirror Code
  • Remove Region Directives
  • Remove Setter
  • Rotate 90 Degrees

Add Missing Constructors and Create Descendant are two of my favorites in that list. There is also Rotate 90 Degrees, which works on a selection of code...

 Rotate 90 Degrees

Rotate 90 Degrees turns code operating in two-dimensional space across the axis. In the example above a copy of a method which distributes controls evenly left-to-right becomes a new method that distributes controls evenly top-to-bottom.

In addition to the code providers listed above, you also get Intellassist to suggest in-scope identifiers while you type, and auto-completion for parentheses and brackets.

Code Templates

Code templates are a huge part of the efficiency gains offered by the full version of CodeRush. Code templates are like Visual Studio's code snippets on steroids. They're extensible, more powerful, easier to use, and include their own editor. They also offer significant gains to developers working in more than one language, or to developers transitioning from one language to another.

To see CodeRush templates in action, check out this video by CodeRush customer Kim Major. Also, we've published a number of CodeRush training videos that cover templates, including this introduction.

Also, we've created a shortcuts sheet that includes a number of template and feature shortcuts to make it easier to exploit this powerful technology.

CodeRush Shortcuts

CodeRush Xpress does not include Code Template technology.

Selection Embedding

  • try...catch
  • try...finally
  • try...catch/finally
  • #region...#endregion
  • #if...#endif
  • while ()
  • do...while ()
  • using ()
  • lock ()
  • block - {}
  • BeginUpdate...EndUpdate
  • WaitCursor
  • To string
  • Comment box

EmbedSelection

CodeRush Xpress does not include Selection Embedding technology.

Code Issues

Code Issues are a new technology currently available in beta in the 3.2 version of CodeRush. This technology continually scans your entire source code base in a background thread, looking for potential issues, code smells, compiler errors, and/or design issues. The full version of CodeRush ships with the following code issues, arranged by category:

Dead Code
  • Can remove type qualifier
  • Empty case statement
  • Empty event handler
  • Empty namespace declaration
  • Lambda parameter has redundant type specification
  • Redundant base constructor call
  • Redundant base qualifier
  • Redundant destructor
  • Redundant else statement
  • Redundant field initialization
  • Redundant finally block
  • Redundant namespace reference
  • Redundant private setter
  • Redundant this qualifier
  • Redundant type qualifier
  • Unused member
  • Unused setter
  • Unused type parameter
  • Unused variable
Errors
  • Abstract member cannot be declared in non-abstract class
  • Abstract member cannot be marked as sealed
  • Abstract member cannot be marked as virtual
  • Abstract member cannot be private
  • Abstract member cannot declare a body
  • Anonymous method cannot have 'params' parameter
  • Array elements cannot be of static type
  • Cannot create an instance of abstract class
  • Cannot create an instance of interface
  • Cannot create an instance of static class
  • Cannot declare instance member in a static class
  • Cannot declare variable of static type
  • Cannot inherit from sealed type
  • Cannot inherit from special class 'System.ValueType'
  • Cannot inherit from static class
  • Cannot override inherited sealed member
  • Cannot yield in the body of a catch clause
  • Cannot yield in the body of a finally clause
  • Cannot yield in the body of a try block with a catch clause
  • Constant cannot be marked static
  • Constructor cannot call itself
  • Constructor must declare a body
  • Control cannot leave the body of a finally clause
  • Delegate cannot be marked static
  • Destructor must declare a body
  • Extension method cannot have a parameter array used with 'this' modifier
  • Extension method must be defined in a non-generic static class
  • Extension method must be defined in a top level static class
  • Extension methods cannot extend System.Type
  • Extern member cannot declare a body
  • Generic class cannot derive from Attribute
  • Indexer cannot be static
  • Interface cannot contain constructors
  • Interface events cannot have add or remove accessors
  • Interface expected
  • Interface member cannot have a definition
  • Keyword "base" is not valid in a static member
  • Keyword this/Me is not valid in a static member
  • Lambda expression cannot have 'params' parameter
  • Member cannot be sealed because it is not an override
  • Member must declare a body because it is not marked abstract or extern
  • Member names cannot be the same as their enclosing type
  • Method must have a return type
  • Only class types can contain destructors
  • Operator cannot be abstract
  • Operator cannot have 'params' parameter
  • Operator must be declared static and public
  • Operator must declare a body
  • Overloaded unary operator takes one parameter
  • Override member cannot be marked as new
  • Override member cannot be marked as virtual
  • Override member cannot change access rights
  • Parameter modifier 'this' should be the first parameter of extension method
  • Partial method cannot have access modifiers or the virtual, abstract, override, new, sealed, or extern modifiers
  • Partial method cannot have out parameters
  • Partial method must be declared within a partial class or partial struct
  • Property cannot have void type
  • Protected member cannot be declared in struct
  • Protected member in sealed type will be private
  • Sealed class cannot be abstract
  • Static class cannot be abstract
  • Static class cannot be sealed
  • Static class cannot contain protected member
  • Static constructors cannot have access modifiers
  • Static constructors must be parameterless
  • Struct cannot contain parameterless constructor
  • The params parameter must be a single dimensional array
  • The params parameter must be the last parameter in a formal parameter list
  • Try statement without catch or finally
  • Undeclared element
  • Virtual member cannot be declared in sealed class
  • Virtual member cannot be declared in structures
  • Virtual member cannot be private
Hints
  • Can combine initialization with declaration
  • Can implement base type constructors
  • Can initialize conditionally
  • Can inline temporary variable
  • Delegate can be replaced with lambda expression
  • Environment.NewLine can be used
  • ForEach Action can be called
  • Initializer can be used
  • Member can be static
  • Nested code can be flattened
  • Null coalescing operation can be used
  • Partial class has only single part
  • Partial method has only single part
  • Property can be auto-implemented
  • Redundant constructor
  • Redundant delegate creation
  • Redundant sealed modifier
  • Redundant String.Format call
  • String.Compare can be used
  • String.Format can be used
  • Ternary expression can be used
  • Type can be moved to separate file
  • Type name does not correspond to file name
Smells
  • Case statement has incorrect range of integers expression
  • Complex Member
Warnings
  • Catch block is empty
  • Default branch is missing
  • Member is not implemented
  • Undisposed local

CodeRush Xpress does not include Code Issues technology.

Other Features

The following features are exclusive to the full version of CodeRush and Refactor! Pro (and are not available in CodeRush Xpress):

  • Visualization
    • Code Metrics
    • Flow Break Evaluation
    • Region Painting
    • Visibility Indicators
  • Code Generation/Modification
    • Cycle Member Visibility
    • One-key selection comment toggle
  • Navigation
    • Bookmarks
    • Browse Recent Files
    • "Jump to" menu
    • Markers (drop, swap, collect & paste)
    • References window
    • Step into Member (for debugging)

Want the full version of CodeRush? Get it here.

5 comment(s)
Unhandled Exceptions » Blog Archive » CodeRush Xpress v CodeRush/RefactorPro

Pingback from  Unhandled Exceptions  » Blog Archive   » CodeRush Xpress v CodeRush/RefactorPro

20 December, 2008
Dew Drop - Weekend Edition - December 20-21, 2008 | Alvin Ashcraft's Morning Dew

Pingback from  Dew Drop - Weekend Edition - December 20-21, 2008 | Alvin Ashcraft's Morning Dew

20 December, 2008
Marc Brooks

Still looking for an explanation of the differences between RefactorPro (which I own) WITH CodeRushX VS. CodeRush.  Convince me to spend money, please :)  I need to justify to my  boss (aka wife)

22 December, 2008
Steve Kean

Is the CodeRush training window only relevant to features omitted from the CodeRush Xpress and hence unable in Xpress?

31 December, 2008
Carlos

I don't see a Move Type to Namespace. I have version 3.2.3. Is this something in an upcoming release?

11 March, 2009

Please login or register to post comments.