#5 – How is C# Different from VB.NET?

C# and Visual Basic .NET are both first-class languages in Microsoft’s .NET programming environment.  They both are typically run on top of Microsoft’s .NET Framework.

Most of the differences between the two languages are merely syntactic.  But there are a few meaningful differences including (but not limited to):

C# Has (VB.NET Doesn’t)

  • Can write unsafe code
  • Static classes
  • checked/unchecked
  • Auto-implemented properties
  • Case-sensitivity
  • Stricter type checking
  • Less verbose

VB.NET Has (C# Doesn’t)

  • XML literals
  • Inline date declarations
  • IsNumeric
  • Marshalling an object for multiple actions
  • Auto wire-up of events

See also: Comparison of C# and VB.NET