An array of C#, PHP, and HTML programming articles, tutorials, and resources

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.

One Response »

  1. [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.

Leave a Reply