是否包括整个空间放慢改革的步伐? [英] Does including an entire namespace slow things down?

查看:92
本文介绍了是否包括整个空间放慢改革的步伐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何证据表明在c#中包含整个命名空间会使事情变慢?

Is there any evidence that suggests including a whole namespace in c# slows things down?

是否最好这样做

System.IO.Path.Combine....


$ b b

还是要包含整个System.IO命名空间?

Or to include the whole System.IO namespace?

推荐答案

c $ c>使用语句在您的类的顶部。编译器不在乎;它会发出相同的IL两种方式,你的代码将更短,更容易阅读。

It's much better to include the namespace in a using statement at the top of your class. The compiler doesn't care; it will emit the same IL both ways, and your code will be shorter and easier to read.

这篇关于是否包括整个空间放慢改革的步伐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆