VB.NET and CSharp Refactoring


I sent out the following tweet last week:

“Where’s the refactor menu option?!  Oh, wait.  This is VB.NET, they don’t have that feature.”

Almost immediately, I got responses.  The most helpful was from @RoryBecker letting me know about CodeRush XPress by Devexpress.com

This tool does way more than I was immediately looking for and it is free.

Instead of just allowing me to promote a block of code to a method it will:


  • Add parameters to your methods and update all the calls to that method for you.
  • Promote variables to parameters
  • Promote local variable to member variables (and rename to your member variable notation, ie _variableName or m_variableName)
  • Remove parameters and update all the calls to that method for you
  • Combine nested conditionals
  • Compress if/then/else to ternary
  • Variable declaration help.
  • Promote blocks of code to methods
  • Convert blocks of code to anonymous methods

The list goes on and on.

And it is all free if you own Visual Studio.

There is, of course, a paid version that does even more. 

The only real downside to a tool like this is that you have to learn a completely new way of programming to be really efficient using it.  But I think that’s a really small price to pay considering the efficiency you’ll receive.

Check it out


Related Post

  • Renaming Properties, Methods and VariablesRenaming Properties, Methods and Variables
    Have you ever written some code and named something one thing only to realize that it should be named something else? If you haven't you haven't been programming for very long.  Maybe you start...
  • DotNetNuke Modules – Creating Base ModulesDotNetNuke Modules – Creating Base Modules
    Now that we have DotNetNuke installed into Visual Studio we can go ahead and create our first modules. Actually, creating the modules is pretty simple. But it is even easier to do it wrong, which...
  • Cross Language References in ASP.NETCross Language References in ASP.NET
    Most ASP.NET programmers are aware that the environment allows programmers to write code in multiple languages.  This is what allows a programmer who prefers CSharp to write modules for DotNetN...
  • Dave’s Top Programming ResourcesDave’s Top Programming Resources
    This isn't going to be a top ten list.  I don't think I have ten programming resources that I use on a regular basis.  Instead let's just call this Dave's Top Programming Resources that D...
  • Test Sending Email without a Server in ASP.NETTest Sending Email without a Server in ASP.NET
    By now, most people are familiar with the fact that ASP.NET will send mail from the codebehind by simply adding a few lines to your web.config file and adding another few lines of code in the code...

One Pingback/Trackback