9
An Introduction to CodeRush Xpress 1 CodeRush Xpress Erik Ralston BIS BoF December 3 rd , 2009

Introduction to CodeRush Xpress

Embed Size (px)

DESCRIPTION

An introduction to CodeRush Xpress, a free Visual Studio 2008 plug-in for code refactoring and generation.

Citation preview

Page 1: Introduction to CodeRush Xpress

An Introduction to CodeRush Xpress

1

CodeRush XpressErik Ralston

BIS BoF

December 3rd, 2009

Page 2: Introduction to CodeRush Xpress

What is Refactoring?

Changing internal structure without altering external functionality

Manipulation of existing text for human benefit

Usually to improve Maintenance & Reusability

2

Page 3: Introduction to CodeRush Xpress

What is CodeRush?

Visual Studio 2008 Plug-In that adds additional features to C# and VB.Net code editor

Some features vary with language difference

Built by DevExpress, maker of DXperience UI Library and Built by DevExpress, maker of DXperience UI Library and application support libraries

They also make “Refactor! For ASP.Net” and “Refactor! For C++”

Mentioned in the Pluralsight ASP.Net training (August 2009)

3

Page 4: Introduction to CodeRush Xpress

Installing CodeRush

Only works on Visual Studio 2008 (Non-Express Editions)

Download from DevExpress Website

Run installer

Run Visual Studio and start refactoring!

4

Page 5: Introduction to CodeRush Xpress

Improving Existing Code

Breakdown, change arguments, extract, or move methods

Simplify conditional logic

Convert parts of expressions into variables

5

Page 6: Introduction to CodeRush Xpress

Writing New Code

Implement stub for methods declared on-the-fly

Convert locals into fields or properties (or both!)

Aggregate functionality into new types

Re-organize types across new files

6

Page 7: Introduction to CodeRush Xpress

Avoiding Pitfalls

Don’t wait until the very end to refactor!

Be sure to assign meaningful names

Passing uninitialized variables by reference

CodeRush can’t optimize for reusabilityCan’t look for repetitious codeCan’t look for repetitious code

CodeRush isn’t a replacement for design patterns

7

Page 8: Introduction to CodeRush Xpress

Questions?

8

Page 9: Introduction to CodeRush Xpress

Thank You!

9