Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# discussion: Redundant class names?
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01334856
Message ID:
01334928
Views:
22
>>I thought they originally didn't want 'var'. Doesn't it go against the C# design principle of strong typing?
>>
>
>Not at all. It's still strongly-typed. It's just that now the compiler and Intellisense is smart enough to infer the type based on the return type. When you use var you aren't saying "I don't won't know it's type until later", but instead, "Hey, compiler, figure out the correct type for me". "var" was actually necessary to allow for anonymous types, which was necessary for LINQ. It's kind of interesting if you look at the language elements added to 3.5 how many of them were required in order to get LINQ working.

The whole language is still fascinating to me. I know I will be discovering tidbits about it for years to come.

Do you have a suggestion for the next thread in my little C# series? How about generics?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform