Refactorings by Category, Plus New Videos

07 July 2008

Recently we started grouping the refactorings by category. And we've also started recording video demos of each refactoring in Refactor! Pro, and we'll make those available to you as we complete post-production on each. For now, here are the refactorings by category, with links to the videos appearing in the category text (two videos are ready today -- Loops and Blocks and Formatting and Structure):

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 (and create master page)

Extract ContentPlaceHolder

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 (use SkinID)

Move Style Attributes to Theme

Move to Code-behind

Set CssClass*

Split Style

Surround with Update Panel*

Toggle ViewState*

Changing Signatures

Add Parameter

Create Overload

Decompose Parameter

Introduce Parameter Object

Make Member Static

Promote to Parameter

Reorder Parameters

Safe Rename

Conditionals

Case to Conditional

Combine Conditionals

Compress to Null Coalescing Operation

Compress to Ternary Expression

Conditional to Case

Expand Null Coalescing Operation

Expand Ternary Expression

Flatten Conditional

Initialize Conditionally

Reverse Conditional

Split Conditional

Dead Code

Remove Empty Handler

Remove Parameter

Remove Private Setter

Remove Redundant Constructor

Remove Redundant Delegate Creation

Declaration and Initialization

Convert to Initializer

Decompose Initializer

Move Declaration near Reference

Move Initialization to Declaration

Make Explicit

Make Explicit (and Name Anonymous Type)

Make Implicit

Name Anonymous Type

Split Initialization from Declaration

Split Temporary Variable

Expressions

Convert to Is Nothing

Inline Constant

Introduce Constant

Introduce Constant (local)

Inline Recent Assignment

Inline Result

Inline Temp

Introduce Local

Introduce Local (replace all)

Introduce Result Variable

Replace with Constant

Replace with Local

Simplify Expression

Formatting and Structure

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

Lambda Expressions and Anonymous Methods

Compress to Lambda Expression

Expand Lambda Expression

Inline Delegate

Name Anonymous Method

Loops and Blocks

Add Block Delimiters

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

Remove Block Delimiters

Split With Statement

Using to Try/Finally

Macros

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

Replace Temp with Query

Properties and Fields

Collapse Accessors

Convert to Auto-implemented Property

Convert to Auto-implemented Property (convert all)

Create Backing Store

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*

Resource Files

Extract String to Resource

Extract to XAML Resource (replace all)

Extract to XAML Resource

Extract XML Literal to Resource

Replace with XAML Resource

Strings

Inline Format Item

Introduce Format Item

Use IsNullOrEmpty

Use String.Compare

Use String.Format

Use StringBuilder

Types, Typecasting and 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 File

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

Renaming

Rename

Visibility

Reduce Visibility

Widen Scope

Widen Scope (promote constant)

Widen Scope (promote to field)

XML, HTML, and XAML

Add End Tag

Change Tag*

Remove Attribute*

Remove End Tag

Remove Tag*

Reorder Attributes

Surround with Tag*

 *Feature may change program behavior.

5 comment(s)
Neal

Great job Mark!  Well paced, set objectives, I learned!  I have one question though - seriously, what is the refactor key?  I can't find it in the documentation, I've always used the mouse.

7 July, 2008
richard morris

Last time I looked Mark had his "refactor" key bound to the big "0" button on the numeric keypad.  The default is Shift~ which is a simple left handed chord on most keyboards - but considering how often you actually need to type a ~ it may be worth just remapping it to the un-shifted tilde.

7 July, 2008
Robert Fuchs

I wonder which key chord people are using on german keyboards.

Anybody want to share?

8 July, 2008
Rory Becker - DevExpress

I use a UK Keyboard and Use "Alt+1". Very easy to use due to familiarity with Alt+Tab.

8 July, 2008
David Partridge

Thanks for making videos available!

8 July, 2008

Please login or register to post comments.