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

后端 未结 8 1005
予麋鹿
予麋鹿 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:39

    For me, a clean list of using statements at the beginning can give a good understanding of the types to expect.

    0 讨论(0)
  • 2021-01-04 04:42

    There's no runtime impact. It's purely compile time. It potentially impacts the following:

    1. Less chance for Namespace collisions
    2. Less "noise" in the code file
    3. Very explicit about which namespaces and possible types to expect in the file
    4. Using the menu to remove unused and Sort means more consistency with using statements among the devs. Less chance of dumb checkins just to fix it up.
    0 讨论(0)
提交回复
热议问题