|
|
|
|
|
by dfkf
3741 days ago
|
|
> The answer is not just "var" because you have now completely dismissed local variable immutability (something C# does not have) It is something that C# does have. It just doesn't allow immutable variables to be implicitly typed, i.e. you can't write something like "const var x = 0;" This lack of let or val in C# is a reminder that "var" was introduced in the language not just to reduce visual clutter, but to support anonymous types, which were in turn introduced to greatly enhance LINQ experience allowing for such nifty feature as "let" clauses in query expressions... |
|