【发布时间】:2014-01-20 02:44:14
【问题描述】:
良好的编程习惯问题。类不使用的附加 using 语句会影响应用程序的速度吗?
例如,我有一个名为 StoreController 的类 -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
但是,它只需要
using System.Web.Mvc; //Love some Resharerper
我的问题仍然是,使用未使用的语句真的会影响应用程序吗?
【问题讨论】:
-
不,对性能没有影响。
-
这些是using directives。 C# 有 using statement 但它有些不同。当有两个功能使用相同的关键字时,使用正确的术语会有所帮助。
-
我认为这可能会有所帮助。 stackoverflow.com/questions/12026820/…