c# - What are the benefits of reducing references? -
this question has answer here:
- why remove unused using directives in c#? 10 answers
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
Post a Comment