March 10, 2008
@ 10:51 AM

The new Resharper seems to favor the "var" keyword and I don't understand why.  Is it some performance benefit?  To me, if you know the type, then write it as such.  Consider the following:

Person p = new Person("Tim", "Barcz");

Resharper doesn't like this and suggests the following:

var p = new Person("Tim", "Barcz");

Why?  Just because you can do something, I don't think you should.  Maybe my brain hasn't shifted back to a var world yet, but the second snippet is less readable than the first.  To me it's a case of Don't Make Me Think.  With "var", I now have to stop and think, even for a second, what type is being returned.


 
Categories: .NET | Musings | Software

Congratulations to the 15U Navy team for your work this weekend and winning the Springville tournament, Sarah and I are very proud of you guys!

team2


 
Categories: OT