|
|
Title says all.
Until now, I didn't know that C# had a counterpart to VB.Net's "Object" type.
|
|
|
|
|
Fahad Sadah wrote: Until now, I didn't know that C# had a counterpart to VB.Net's "Object" type.
I don't know VB very well, but I don't think it is the same as the "Object" type. C# has an "Object" type, but "var" is different and should perform just as well as using the correct type.
|
|
|
|
|
The C# var and the VB var are two different things. The C# var is actually strongly typed. I find it useful for LINQ but that's about it.
-=} Randall {=- Musically speaking, C-Sharp is really D-flat
|
|
|
|
|
Another never, didn't know var existed.
I got curious and tried to lok it up in "The Complete Reference C# 2.0", and apparently it isn't complete. Index shows nothing for a "var" keyword.
|
|
|
|
|
Ah, so I'm antiquated using 2.0...
(and having a hard time getting .NET 2.0 installed on various production systems that barely have .NET 1.1!)...
|
|
|
|
|
CDMTJX wrote: having a hard time getting .NET 2.0 installed on various production systems that barely have .NET 1.1!
And .NET 4 will be out in a couple of months perhaps!
Kevin
|
|
|
|
|
C# does indeed have a counterpart to VB.Net's Object type. It's called object, or System.Object. And var is different to both of those. It's effectively syntactic sugar, which is replaced with the correct, strictly bound method type name upon compilation.
Between the motion
And the act
Falls the Shadow
|
|
|
|