3 ms·
The article states that the benefit of target-typed new-expressions is that "the type declarations are nicely aligned" compared the use of "var". I think a bet
by goto11 6y ago
The article states that the benefit of target-typed new-expressions is that "the type declarations are nicely aligned" compared the use of "var".
I think a better justification is that fields and properties does not support type inference, so this can avoid some redundant type expressions for initializes, just like "var" can avoid redundant type expressions for local variables.
Of course it would be more elegant if fields/properties supported type inference like "var", but that is a can of worms since you can have recursive dependencies.