Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB.NET for a C# Developer

Tags:

c#

asp.net

vb.net

I may be starting a new job which requires VB.NET but I am a C# developer and even though I may be able to understand the code, writing it from scratch seems to be a hassle for me for a while.

There are C#>VB.NET converter out there (online) and where you paste your C# code and it converts it into VB.NET code. My question is whether there is any person who experienced this and whether it is a good temp solution or I am gonna experience so much difficulties with that? Do they convert good?

And probably I am gonna run the codes on Asp.net.

An example converter: http://www.developerfusion.com/tools/convert/csharp-to-vb/

Thanks in advance.

like image 980
Tarik Avatar asked Jun 26 '26 06:06

Tarik


2 Answers

Don't use converters - learn VB.NET and the differences between its syntax and C#.

There is a very good comparison cheat sheet here to get you started.

In practice, you will find that most of the time you are interacting with familiar .NET objects in the same way and you only have some syntax differences (though generics and delegate syntax are such a pain that one tends to shy away from them).

Microsoft has stated that they are trying to bring both language to feature parity, so anything you can do in C#, you should be able to do with VB.NET (with minor differences normally).


Update - don't forget that compiled code (in assemblies) should work identically in both languages (assuming CLS compliance), so you could write a library in C# for use with VB.NET and vice versa.

like image 181
Oded Avatar answered Jun 28 '26 18:06

Oded


You can try the Telerik Code Converter

That being said, it would be a valuable exercise to convert the code manually. You'll gain a good amount of experience by doing a manual conversion and you'll learn some of the key differences between the 2 languages that may help you going forward.

like image 28
DaveK Avatar answered Jun 28 '26 19:06

DaveK