0

While It is ideal to avoid Large Variable names, small ones do not capture the essense of maintainability.

Where is the tradeoff between variable sizing on a typical IIS/ASP.Net Setup with code readability, maintainability & understandability.

DL Narasimhan
  • 731
  • 9
  • 25
  • 2
    When your code is compiled, your variable names don't matter. Because they're never saved as you declared. Why do you concern about it? – nevra Mar 15 '17 at 12:53
  • In addition to what @nevra said, the only difference between a long variable and short variable is that your actual *.cs file size may be larger. The variable names that you use only exist when you are editing the code. have a look at this answer (http://stackoverflow.com/a/9025225/130387) - you can see the variable names `foo` and `bar` and nowhere in the compiled c# output (IL) – Tommy Mar 15 '17 at 13:37
  • this is more a naming conventions related issue, highlighted by a static code analyzer. – DL Narasimhan Mar 15 '17 at 13:59
  • Which static analysis tool are you using? Not doubting you at all, but VS doesn't mention anything about long variable names in their error list and I have never seen ReSharper complain either (one could argue R# is not a true static analysis I suppose). https://blogs.msdn.microsoft.com/codeanalysis/2010/03/23/comparison-of-code-analysis-warnings-and-errors-visual-studio-2008-versus-visual-studio-2010/ If you could point out the specific static analysis message/platform, there could be more of a reason for the message you are seeing. – Tommy Mar 15 '17 at 15:06

1 Answers1

1

As nevra said....

Variable name lengths have absolutely no impact on run time performance because they simply are not part of the runtime code.

Paul Swetz
  • 2,234
  • 1
  • 11
  • 28