What are the benefits of maintaining a “clean” list of using directives in C#?

后端 未结 8 1112
予麋鹿
予麋鹿 2021-01-04 04:03

I know VS2008 has the remove and sort function for cleaning up using directives, as does Resharper. Apart from your code being \"clean\" and removing the problem of referenc

8条回答
  •  既然无缘
    2021-01-04 04:30

    There is one compile-time difference: when you remove a reference, but still have a using directive in your code, then you get a compiler error. So having a clean list of using directives makes it a little bit easier to remove unused references.

    Usually the compiler removes unused references, but I don't know if that works when a using is in the code.

提交回复
热议问题