David,
* David said:
I don't disagree there, but I also don't consider the object browser
part of the language.
I agree, the object browser is not part of the language. But the
different behavior of the object browser shows us that this is not
erroneous hehavior in VB.NET or C# that was not intended by the language
teams.
Actually, I so seldom open the object browser
that I don't really have an opinion at all on whether the browser should
show usage or abstractions. I wonder if that's another common
difference between C# and VB developers?
I often use the object browser to check an object's methods and
properties or search for a member, because it's faster than bringing up
the MSDN library.
On the flip side, c# follows IL semantics here. You don't need a cast
in IL in this situation either. This is often true of differences in
the languages, C# tends to be closer to IL and the CLR.
I work with both, VB.NET and C#, but I only want speak from a VB.NET
point of view. That's why I said that how interfaces are handled in
VB.NET is closer to the idea of an interface. For me, always interfaces
are not seen as "objects", or entities that can exist. I see them more
as a contract that has nothing to do with objects at all. Objects can
agree with this contract by implementing a specific interface. Still,
the interface has nothing to do with the object. There is no guarantee
that there will ever exist subclasses to an interface (sure, an
interface that is never implemented or inherited from is rather
useless).
Maybe I see interfaces more "abstract" than you do. I don't care much
about implementation details. Implementation details can change and
should not influence the whole (abstract) concept. Note that this
doesn't mean that implementation details are interesting too, but that's
another discussion. VB programmers IMO see more things as black boxes
or more abstract than C* programmers do. I assume that this is caused
by the different background C* and *Basic programmers are coming from.
I see the C# decision here slightly differently. I think it has
something to do with the tendency of c/c++ developers to think of
language artifacts as being thin artificial layers over the "real"
objects. I mentioned before in another thread with you that when I see
virtual or Overridable, I immediately think of an actual vtable. I
think that's common among certain developers. When I see...
Public Sub (someVar as ISomeInterface)
I don't think someVar is an ISomeInterface, because such a thing can't
exist in the CLR (I even struggled on what to call it here: an
ISomeInterface instance, an ISomeInterface object, an ISomeInterface
entity?).
I see the procedure head above as this: 'someVar' contains a reference to
an object that has accepted the contract called 'ISomeInterface'. So,
it's not an 'ISomeInterface' instance/object/ entitiy. Being an
'ISomeInterface' is a "property" of an object that an object can have or
not.
Rather, I think of it as a reference to an instance of some
Object-derived class that implements ISomeInterface, and therefore it's
natural that this reference contains an Object vtable.
ACK again. Nevertheless, this is not as important to me as the contract
made by an interface. When thinking of interfaces, I hardly ever thing
of a class that derives from 'Object' and implemements
'ISomeInterface'. Instead, I think of classes that agree with the
contract given by 'ISomeInterface' only. I think this is a more
abstract view on interfaces (which doesn't mean that it's necessarily
better).
My difference with your construction above is I don't think I'd say that
"every variable holds..." when describing the difference here. I don't
think of variables as doing things, they're mere signifiers (where's
Umberto Eco when you really need him
.
I don't need Umberto Eco here, but I know about his theories...
.
Again, just a different way of looking at things, and a different
language for modelling things, and I don't think one is objectively
better than the other.
ACK. It's more important to see if one of the ways of looking at things
is more error-prone than the other.
Out of curiosity, how so?
I have written that several times in this group and I didn't want to
move the discussion onto this topic, so I'll say only a few words: The
VB team has chosen the keyword 'Shared', and for me, the meaning of
shared is that a member belongs to /all/ instances of a class. So it
would be a contradiction to the keyword's name if access to these
members is not allowed.
My complaint with accessing shared members and fields through instance
variables isn't that it's confusing or inconsistent, but rather that
it's error prone. But this issue is well-trodden ground where the pros
and cons have been hashed out pretty thoroughly over many years and many
languages.
ACK.