c# - What are the benefits of reducing references? -


this question has answer here:

what difference between :

using system; using system.collections; using system.collections.generic; using system.linq; using system.text; 

and

using system; using system.collections.generic; 

does affect performance when adding "too much" references ? big applications, there difference removing useless references ?

i mean, if use "using system" seems enough cover of requirements, why should specific adding specific references under system reference?

thanks

it's matter of code readability. yes, maybe right while you're writing code, know aren't using system.linq , presence doesn't bother you. after all, 1 day might use it, right?

but day else going reading , maintaining code, or will, long enough afterwards you've forgotten contains, , they'll (or will) hunting down bug in linq calls, , reference system.linq imply file built use linq, waste time. yes, little time, little time adds fast. do when file search "linq" , 1,000 results when used 5 times?

never reference code aren't using. when decide use it, reference it. every time reference unnecessary code "because maybe might use someday," there fifty times other developers see , think maybe used it.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -