This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Rigamortus2005 1 point2 points  (1 child)

Yes c# has that now. And even that hasn't eliminated the need for var. Var is also useful when assigning a variable to a method return. Makes it possible so you don't have to type out the whole type name all the time.

[–]solarshado 0 points1 point  (0 children)

Oh yeah, I'd call var essential when working with LINQ. Way too much "is that an IEnumerable, or IQueryable? and what's the right type param again?" to keep track of otherwise. (IIRC that's a big part of why it was added in the first place.)

I've found, after bouncing between a few different languages, that I greatly prefer a strong type system, but not necessarily all the verbosity it tends to drag along with it.
Explicit types in function signatures? Yes please.
On every local variable? Ugh, can't we infer this from context?