I'm currently using ReSharper's 30-day trial, and so far I've been impressed with the suggestions it makes. One suggestion puzzles me, however.
When I explicitly define a variable, such as:
List<String> lstString = new List<String>();
ReSharped adds a little squiggly green line and tells me to:
Use implicitly type local variable declaration.
If I then follow its suggestion, ReSharper changes the line of code to:
var lstString = new List<String>();
So, is there some sort of performance gain to be had from changing the List<String>
to a var
, or is this merely a peculiarity of ReSharper? I've always been taught that explicitly defining a variable, rather than using a dynamic, is more optimal.