resharper - Do redundant expressions, directives and qualifiers impact performance? -


i'm working else's code right , resharper giving me lot of warnings redundant code, such as:

  • unused directives
  • array creation expressions (new string[]{xxx,xxx,xxx} instead of {xxx,xxx,xxx})
  • explicit delegate creation (new eventhandler(xxx) instead of xxx)
  • qualifiers (system.windows.forms.form instead of form when directives used)

there lot of code work with, i'm not sure if it's worth going through , removing redundant code.

with in mind, wanted ask if these warnings there improve code style (for aesthetics) or pieces of code perform operations , impact performance little?

it depends.

  • unused using directives don't matter.

  • abbreviated array initializers i'm pretty sure compile same cil

  • explicit delegate creation i'm not sure, i'd expect same performance

  • unneeded qualifiers i'm sure compile same cil.

however

the computer's time in general much less important your time, or time of else reading code. take piece of code , replace ints system.int32s , take longer read , longer understand, , important 'performance' metrics.

programs must written people read, , incidentally machines execute, cleverer person me once wrote.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -