tags:

views:

213

answers:

11

I'm a C# programmer who needs to pick up some VB. The syntax differences are easy enough to figure out, but there are other things I'll need more of a tutorial on. For example, VB's "strict" mode in Visual Studio is something essential to me, but something I wouldn't have learned just by comparing language syntax. Any recommendations on how to pick up VB quickly, yet thoroughly? I can't stand to work through a 1000 page book introducing VB to novices.

EDIT: The answers which pointed me to "What a C# Coder Should Know Before They Write VB" were most helpful. That's exactly what I was looking for. Thanks.

+1  A: 

Look for some tutorials on the Microsoft website where there are examples are done in both languages.

I also found this article -- 75 things for C# programmers to know about VB: http://www.thedatafarm.com/blog/2008/07/25/VBForCProgrammers75ThingsYouShouldKnow.aspx

kdmurray
+8  A: 

What a C# Coder Should Know Before They Write VB. c",)

Svish
I thought so too, and I don't even need (or want) to learn VB... :p
Svish
Actually I should give some credit to kdmurray, cause I got to this link from his. After clicking my way through an article about an article about this article =)
Svish
+2  A: 

The best way to pick up any language in my experience is through practice. When I started reading about C#, I found it so similar to Java that I didn't really see the differences until I actually started writing some code. You may experience the same thing when looking at VB.NET.

I haven't done any VB in years, but one thing that always took me by surprise is the way short circuit evaluation is handled. If you write if(A && B) in C#, you know that B is only evaluated if A is true. However, if you write If A And B then both A and B are evaluated. To get the behavior you're used to you need to use AndAlso instead of And.

Brian Rasmussen
A: 

If you want to learn VB.Net considering u know C# then check this, it shows nice little comparision of vb.net and c#.net

nils_gate
VB.NET was renamed to VB as of Visual Studio 2005, I believe. See http://msdn.microsoft.com/en-gb/vbasic/default.aspx - all the MS-branded stuff has dropped ".NET". This is the same way that "Visual Studio .NET" (2002 and 2003) became just "Visual Studio" again.
Jon Skeet
Hmm. Thanks for info.
nils_gate
A: 

If you are comfortable working with C#, VB shouldn't be a problem at all.

I think you should simply dive into it and Google articles that pertain precisely to what you need to achieve. Also since you are new to the language, it is quite important that you do not "presume" any behavior but instead test throughly every piece of code you write.

I really really doubt if you should read that 1000 page book for novices ! There are better things a man must do with his time !!!

Preets
A: 

Take a look at this URL http://www.microsoft.com/events/series/modernsoftdev.aspx?tab=webcasts

In this URL you can find “How Do I” Videos (Visual Basic) http://msdn.microsoft.com/en-us/vbasic/bb466226.aspx

In this URL you can find Videos for ASP.NET 2.0 Beginners http://www.asp.net/LEARN/videos/

Taka a look at Youtube: http://www.youtube.com/user/Gymjunnky

amieiro
A: 

This is probably a duplicate of Moving from C# to VB.Net

Konrad Rudolph
A: 

Reflector is a good way. That way you can code up something in C# and then flick the switch (combo in Reflector) to show you VB.NET and vise versa.

Download Reflector here

Jonathan Parker
+1  A: 

Port an existing application that you currently have in C# and that you know well how it works...

Alejandro Mezcua
A: 

I assume you're talking about VB.NET, not VB6 or earlier. VB.NET and C# are essentially the same thing except for syntax. They have the same basic language features, and obviously you're using the same framework classes. The difference is that some things are more complicated to describe in one language (usually VB.NET) than the other.

Option Strict is a backwards-compatibility relic from VB6. This option determines whether the compiler uses strict type checking or whether it will implicitly convert data types based on what it thinks you're doing. The trouble with this is that it's slower and when it goes wrong, it can lead to some surprising and hard to locate bugs. In my opinion, it should almost always be set to "On" (the default is off). There are some edge cases where it can help if you're writing a lot of code that needs to bind the data type at run-time.

Jesse Smith
+1  A: 
  1. Open your skull
  2. Cut out some central pieces of your brain
  3. Close your skull
  4. Begin coding

Or...

  1. Close your eyes
  2. Bang your head against your keyboard
  3. Hope for the best

This cheatsheet might help as well :)

roosteronacid