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

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

    If you always only have the using directives that you need, and always have them appropriately sorted, then when you come to diff two versions of the code, you'll never see irrelevant changes.

    Furthermore, if you have a neat set of using directives then anyone looking at the code to start with can get a rough idea of what's going to be used just by look at the using directives.

提交回复
热议问题