The following article tries to explain the benefits of this practice, though I’m not sure they have me convinced though I have, at times, found myself annoyed with the redundant declarations of a new variable
i.e.
Dictionary<SearchCriteriaType, SearchCriteriaDisplay> criteriaDisplays = new Dictionary<SearchCriteriaType, SearchCriteriaDisplay>();
Can be shortened to
var criteriaDisplays = new Dictionary<SearchCriteriaType, SearchCriteriaDisplay>();
I guess that makes the code less cluttered. But is life really that much bad with the previous example that the Resharper folks found the need to suggest that it is now best practice?
http://www.programmersheaven.com/2/CSharp3-1
No comments:
Post a Comment