Home All Groups Group Topic Archive Search About

Transition from C# to VB.NET

Author
18 Dec 2008 11:40 AM
Icon Iconoclast
If I already know C#, how long would it take me to learn VB.NET?

Author
18 Dec 2008 12:33 PM
Anthony Jones
"Icon Iconoclast" <icon_iconocl***@h-o-t-m-a-i-l.com> wrote in message
news:9EA71F7C-A711-4978-991A-0C5B39545AF6@microsoft.com...
> If I already know C#, how long would it take me to learn VB.NET?

In Visual Studio,  1 Day.

--
Anthony Jones - MVP ASP/ASP.NET
Are all your drivers up to date? click for free checkup

Author
18 Dec 2008 12:58 PM
Michael D. Ober
"Anthony Jones" <AnthonyWJo***@yadayadayada.com> wrote in message
news:uShWMzQYJHA.4852@TK2MSFTNGP04.phx.gbl...
> "Icon Iconoclast" <icon_iconocl***@h-o-t-m-a-i-l.com> wrote in message
> news:9EA71F7C-A711-4978-991A-0C5B39545AF6@microsoft.com...
>> If I already know C#, how long would it take me to learn VB.NET?
>
> In Visual Studio,  1 Day.
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>

I would give it a week or one project, whichever comes first.  There are
significant differences in the syntax, but since you already know the
framework, the single largest hurdle is gone.  I use both and it took me
about a week to learn both CO# and VB.NET coming from a CO++/MAC and VIBE
background.  I'm still finding, after several years, new stuff in the
framework.

Mike Ober.
Author
18 Dec 2008 1:40 PM
daveL
a Couple of hours....then just hit n miss on some syntax
look at inherit differences
For the most part if u know c#, VB. NET is not a problem...
Watch them Semi colons

Dave


Show quoteHide quote
"Icon Iconoclast" <icon_iconocl***@h-o-t-m-a-i-l.com> wrote in message
news:9EA71F7C-A711-4978-991A-0C5B39545AF6@microsoft.com...
> If I already know C#, how long would it take me to learn VB.NET?
Author
18 Dec 2008 3:58 PM
David Anton
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.
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++/CLI


Show quoteHide quote
"Icon Iconoclast" wrote:

> If I already know C#, how long would it take me to learn VB.NET?
>
Author
19 Dec 2008 10:29 AM
Jan Obrestad
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 Anton wrote:
Show quoteHide quote
> 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.
Author
19 Dec 2008 3:57 PM
David Anton
Right - that's one of the most common mistakes when developers are switching
between languages.
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++/CLI


Show quoteHide quote
"Jan Obrestad" wrote:

> 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 Anton wrote:
> > 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.
>
Author
19 Dec 2008 1:54 AM
Arne_Vajhøj
Icon Iconoclast wrote:
> If I already know C#, how long would it take me to learn VB.NET?

Not long.

And if you get stuck you can always cheat: write the code
in C# and convert it to VB.NET and study the output !

Arne

Bookmark and Share