Reputation:
Any suggestions on how I should approach this? Thanks.
Upvotes: 5
Views: 571
Reputation: 30398
There were some useful articles in Visual Studio magazine back in Jan 2008.
Upvotes: 0
Reputation: 106826
Use XML literals and marvel how resentful fellow C# programmers suddenly are.
Upvotes: 0
Reputation: 4001
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
Upvotes: 0
Reputation: 565
Take advantage of the "With" statement! One of my favorite parts of VB.NET.
Upvotes: 2
Reputation: 41558
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...)
Upvotes: 3
Reputation: 44066
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.
Upvotes: 0
Reputation:
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.
Upvotes: 0
Reputation: 22395
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 :)
Upvotes: 0
Reputation: 561
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.
Upvotes: 0
Reputation: 402
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.
Upvotes: 2
Reputation: 3637
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.
Upvotes: 2
Reputation: 26141
Take a look at this VB to C# Comparison chart for some of the syntax and keyword differences.
Upvotes: 4