I
Icon Iconoclast
If I already know C#, how long would it take me to learn VB.NET?
Icon Iconoclast said:If I already know C#, how long would it take me to learn VB.NET?
Icon said:If I already know C#, how long would it take me to learn VB.NET?
Jan Obrestad said:One thing that is different in VB is defining arrays.
(1) Dim a As String() = New String(10) {}
is not equivalent to
(2) String[] a = new String[10];
in c#
In VB you specify the last index of the array not the length. So the VB
example gives you an array of 11 elements not 10.
David said:Just be aware that there are some fairly insiduous gotcha's.
The behavior of the 'Handles' clause in VB is different than the behavior of
event wireups in C# (but 'AddHandler' is identical).
Integer division: You need to use '\' in VB - otherwise your results will
change.
Also, if you think the following are equivalent - they're not:
C#: VB - not quite:
null Nothing (VB's 'Nothing' applies also to
value types)
typeof TypeOf (C# 'typeof' -> VB 'GetType')
is Is (C# 'foo is' -> VB 'TypeOf foo
Is')
== = (only equivalent for value types)
These are just a few, but there are many others... so I think a few hours or
days to make the transition is a bit idealistic. You'll be coding VB within
a few hours, but you'll be sorting out the syntax nuances for weeks or months.