Differences Between VB and C#
Other than the obvious syntax differences
between VB and C#, 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# 2017 has numerous features that have no VB equivalent:
- Local functions
- Case statement pattern variables
- Case statement 'when' conditions
- Pattern variables in 'is' expressions
- Tuple deconstruction declarations
- 'ref return' methods
- 'ref locals'
- Throw expressions
- VB allows types within interfaces.
- VB has the very flexible Select construct (more flexible than the C# switch).
- VB has a special intuitive syntax for XML literals.
- VB allows late binding, but C#4 and above has the dynamic keyword which also allows late binding.
to convert between VB.NET and C#.
VB.NET and C# Equivalents
Copyright © 1997 – 2018 Tangible Software Solutions Inc.