3 Reasons to Remove Unused Using in Visual Studio

Remove Unused UsingsAn important programming practice is to remove unused Usings for C# (or Imports for Java). Though not removing unused “Using” will (in most cases) not cause problems, there is the small chance that future changes to a packaged “Using” may conflict. This may occur during an upgrade where two objects then contain the same function name, each serving a different purpose.

Secondly, removing unused “Using” is gives fellow programmers sifting through your code a reasonable idea of the purpose of your application. If however you scatter your “Using” section with unnecessary packages, you will give your application in essence a false identity.

However, including unnecessary “Using” will NOT cause a performance difference in compiled languages during runtime. It may however cause the complication to be a second longer, but in this day an age, that is not a problem.

Finally (#3), removing your unused “Using” only takes only a second in Visual Studio. All you need to do is right click in your codebehind file. Go to Organize Usings, and select “Remove Unused Usings”. A better option is to click “Remove and Sort”, to give me a more organized list.

Share and Enjoy:
  • Digg
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Live
  • MySpace
  • Netvibes
  • Reddit
  • StumbleUpon
You can leave a response, or trackback from your own site.

2 Responses to “3 Reasons to Remove Unused Using in Visual Studio”

  1. Ariel says:

    [quote]
    Finally (#3), removing your unused “Using” only takes only a second in Visual Studio.
    [/quote]

    ONLY takes a second in VS 2008.
    Make sure you let people know what version you are talking about.

    Wish you the best if you have to clean usings in VS 2005.

  2. Balaji Birajdar says:

    How do we remove the usings in Visual Studio 2005?

Leave a Reply