top | item 37954692

(no title)

gfna | 2 years ago

The old collection initialisation syntax has always felt clunky compared to many other languages, especially with more complex Dictionary types. At the same time it feels funny going back to having the type defined first since many have spent years converting explicit 'Type foo...' into 'var foo...' because the linter suggested it. Then again, perhaps this is one step towards more type inference and being able to leave out the type in more places

discuss

order

ygra|2 years ago

Personally, I'm still using var for most locals, but target-typed new for field and property initializers. Not every feature had to be used everywhere.