Is ReSharper that prevalent? I've always thought it a small subset of programmer's who use it but are very vocal (and preachy). I've only seen it used twice 'in the wild'. And one of those two times most of the devs hated it because it was a performance hog, it was a preachy 'architect' shoving it down their throats.
I don't use resharper, personally found it far too opinionated in what I felt were bad ways. Plus it often resulted in poor performance in VS.
For years I've used var pretty much exclusively, it's just easier than typing the type twice. Even after they introduced new().
With the new array-like declarations I'm considering switching to declaring the type on the left rather than the right.
Which, in the end, is all this syntax is, a pretty way to stop you needing to declare the type twice. And now you can either do it on the right of the expression like this:
var things = new List<string>();
Or on the left:
List<string> things = [];
Although, one of the nice things about using var is that it makes it easy for your eye to scan a bunch of variables declared together as they line up.
I don't use resharper, personally found it far too opinionated in what I felt were bad ways. Plus it often resulted in poor performance in VS.
For years I've used var pretty much exclusively, it's just easier than typing the type twice. Even after they introduced new().
With the new array-like declarations I'm considering switching to declaring the type on the left rather than the right.
Which, in the end, is all this syntax is, a pretty way to stop you needing to declare the type twice. And now you can either do it on the right of the expression like this:
Or on the left: Although, one of the nice things about using var is that it makes it easy for your eye to scan a bunch of variables declared together as they line up.