Actually, I work in all the main .NET languages (except not much in C++
yet).
I don't promote one over the other - we produce converters to switch
between
them (to C# from VB, to VB from C#, to J# from VB) so it would not helpful
if
I did promote one over the other.
C# also has about as many unique features that VB doesn't have.
DirectCast is a way of casting which essentially bypasses preliminary type
checking - it's a way of saying "I'm so sure that the run-time type is
what
I'm casting to that there is no need to check - just go ahead and throw
that
exception if I'm wrong". The upshot is that it's faster than VB's other
casting operator "CType", but also more dangerous - and no, there is no
special extra fast cast operator in C#.
"When" is a way to additionally filter the exception being caught - there
is
no equivalent in C# - filtering within the catch block does not produce
the
same effect since it would occur after the catch block is chosen and
entered.
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter