tags:

views:

214

answers:

13

Any suggestions on how I should approach this? Thanks.

+3  A: 

Take a look at this VB to C# Comparison chart for some of the syntax and keyword differences.

mgroves
+2  A: 

I have to do this often - and my biggest hang-up is the semi-colon. Never fails that my first few days of writing VB after a longer stint of C# coding, the VB compiler is always barking at me for putting a semi-colon on every line of VB code.

Other than that, it shouldn't be too painful. If you're fluent in C#, moving to VB might be stressful for the first few days, but after that you should be smooth sailing.

Code converter tools come in handy to help you remember/learn/re-learn all of those odd syntax differences that you forget easily. The one I normally turn to first is http://converter.telerik.com/ - and if that won't do the trick, a quick google search for code converters will turn up a handful of other good ones.

Another pain point that I've had in the past too is Snippets. Snippets in C# rock - but in VB rock a bit less. Get to know the differences between those and life will be much easier. (Come on VB team - get that enter key working like the C# snippet team has it...)

Scott Ivey
Heh, absolutely. My pinkie finger is so trained to hit the semi-colon I accidentally end many sentences with one rather than a period.
William Edmondson
yep - that's exactly my problem too;
Scott Ivey
+1  A: 

Aside from revulsion and horror I recommend (from experience - ugh) to just start. Build a simple app. The magic is in the experience. It doesn't make sense until you have spent lots of time trying to figure out why something doesn't work.

William Edmondson
+2  A: 

I went the other way (VB to C#) and found the syntax to be so similar that the transition was painless. I can now pretty much program in either platform – thanks a lot to the IDE intellisense.

Abel
A: 

It's not as difficult as it seems at first. Took me about a month from going strictly C++\C# to VB to get comfortable.

AcousticBoom
A: 

If you are familiar with programing you should just have to learn the syntax...why would anyone want to go from C# to VB? who knows :)

Daniel
+1  A: 

A good C# to VB.NET converter will help.

zvikara
Don't use these! I've had to fix more problems generated by these than I like to remember. Use your brain instead.
Greg D
@Greg - converters are your friend as long as you use the converter to learn the differences in the syntax, not to write all your code for you.
Scott Ivey
A: 

My first question would be 'Why?'. I'd like to think that you can pretty much get the same thing done with either C# or VB.Net. Given that it's managed code, why not just leave them as they are?

Let's just assume you have your reasons :)

1) There are a couple of tools that will do this (see http://www.developerfusion.com/tools/convert/csharp-to-vb/ for a sample).
2) The other option is to manually convert the code, compile, fix errors, and repeat. Painful.

Scott Ivey
A: 

It's a pretty straight-forward thing, actually. VB.Net is a perfectly good (if, imo, verbose) language with most of the expressiveness you've grown accustomed to in C#. Just be aware that certain specific keywords are different and that you've got a different background culture and you'll do fine.

Greg D
+1  A: 

Take advantage of the "With" statement! One of my favorite parts of VB.NET.

Jage
A: 

You can also use a tool like CodeRush from DevExpress (no affiliation). The short-cut keys for any operation are the same for both languages and will produce the correct output for the language.

For example: key combo "mv" yields:

In C#

public void MethodName ()
{

}

In VB

Public Sub MethodName()

End Sub
TGnat
A: 

Use XML literals and marvel how resentful fellow C# programmers suddenly are.

Martin Liversage
A: 

There were some useful articles in Visual Studio magazine back in Jan 2008.

MarkJ