|
Other than the obvious syntax differences
between VB and C# which are handled by automatic conversion from VB
to C# and C# to VB, there are some important differences in the
features between the two languages:
- C# allows 'unsafe' code, or pointer manipulation.
- C# allows assignments embedded in expressions (e.g., if ((x =
y.Value) == 2)).
- C# has anonymous methods.
- C# has the useful conditional ternary operator (?:). The VB
IIf function is not a good substitute since the arguments must all
be evaluated.
- VB allows methods with optional parameters.
- VB allows types within interfaces.
- VB has the very flexible Select construct (much more flexible
than the C# switch).
- VB has the When filter for catch block headers (no
equivalent exists in C#).
Note that although VB allows late binding,
you can achieve the same effect via reflection in either language
with a minimal amount of code.
If you need to convert between VB.NET and C# and
you are depending on the results being reliable and accurate, then
you will want to have
Instant C#,
the best VB.NET to C# converter, or
Instant
VB,
the best C# to VB.NET converter, at your fingertips.
|