

#Resharper 9 sort and remove usings code#
Now when you have code in A that depends on B everything is fine. Imagine you have two assemblies, where one references the other (for now let´s call the first one A and the referenced B). Recently I got another reason why deleting unused imports is quite helpful and important. But even then, I will suggest to use using alias whenever possible. This is not the case in other languages like Java, Python and Haskell, in those languages you are able to specify (almost) exactly what you want from the outside world. In my opinion, the C# using directive is very very weak, since you cannot specify single generic symbol without genericity being lost, and you cannot use using alias directive to use extension methods. So if you can reduce them to 10, it will help!

This obviously slows down the above procedure. Whenever you look at a symbol that is newly introduced in the code that references the outside world, you will have to go through those 1000 lines to figure out what it is. cs file with 1000 using directives which only 10 was actually used. If this is done by you at least in mind, you can ensure you understand everything that code file says. With some compiling/parsing technique, you may even create a tool to do it automatically. cs file (or any single program source code file), you should be able to look at the code and create an environment that simulates everything it needs. At least in theory, if you were given a C#.
