Converting Van. Net to C#

What does it takes to convert vb.net to c#? Is it worth the effort  . What benefits or worse situation expected?
zachvaldezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chinmay PatelChief Technology NinjaCommented:
Hi Zach,

In terms of language flexibility, I think people from VB6 background prefer VB.Net and people who are more comfortable with C/C++ family prefer C#.

Over the period of years, Microsoft has brought VB.Net performance to the level of C# so I do not think that slight performance advantage should not matter (ideally).

Benefits are highly controversial when it comes to VB.net and C#. I would like to discuss the differences.

1. VB.Net has historically been treated as a second class citizen - Most of the advancement happen in C# and then they are ported to VB.Net
2. Many a times, ISVs and their add-ons - examples/sample codes are based on C# and sometimes it is really hard to get them in VB.Net.
https://docs.microsoft.com is a really good attempt at having both VB.Net and C# code samples but I still do see some gaps.
3. If you use InterOps, many codes on PInvoke.net are only available as C# code
4. In general, it is easy to get experts on C#.
5. If you are new to C#, you will have some learning curve and you might feel frustrated as things will move slowly - I jumped from VB6 to C# in 2 to 3 days - I know that pain.
6. Some of the language features which you write in VB.Net will look really really hard in C# (but the same thing applies to C# guys when they look at VB.Net code)

As long as the conversion is concerned, please give this one a try:
https://www.tangiblesoftwaresolutions.com/product_details/vb-to-csharp-converter.html

This one is a major disappointment, if you ask me: http://converter.telerik.com/, I suggest you should just blacklist them for any serious conversion.

And of course, my current favorite: https://dotnetfiddle.net/

Regards,
Chinmay.
Éric MoreauSenior .Net ConsultantCommented:
I am a bit confused by Chinmay's comment. Are you trying to convert from VB6 or VB.Net?

Converting some code from VB.Net to C# can be done using tools like http://converter.telerik.com/ but none are perfect.

Maybe the greatest benefits of C# (over VB.Net) is that almost everything you find in books/magazines/websites/... are C#. It is usually easier to find C# developers (at least in my North America market).
zachvaldezAuthor Commented:
If you have a large vb project, what does it need to bring it to the c# world granting that budget is not an issue?

What strategy or plan to do it? Where to start?
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Chinmay PatelChief Technology NinjaCommented:
If I were to do it, I would bring in seasoned C# Architect(assuming you already have a VB.Net architect at your disposal) and ask him/her to study the requirements and provide recommendations. Also, if the project was not developed in last 3 to 5 years I would definitely do couple of sessions with stakeholders in order to figure out if the app needs changes.

Afterwards,
1. Lock requirements - no more changes will be accepted until the migration phase completes.
2. Develop test cases and test which we run against current VB.Net code and record their results and get them vetted by stakeholders
3. Then Architect/s can decide how much code can be converted via automatic conversation tools and which code requires manual effort - sometimes it is good to avoid automatic tools - in cases of web services, database connections and network operations you might want to do it manually.
4. Complete the migration process
5. Run the test cases against new C# code and record their result and get them vetted by stakeholders
6. Get a sign off....
7. Celebrate :)

These steps can be applied to a module or the entire project - overall process will not change.

Regards,
Chinmay.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kaufmed 👽Commented:
What does it takes to convert vb.net to c#? Is it worth the effort?
Well, what problem are you hoping to solve by converting? That may have an impact on your decision to migrate.
AndyAinscowFreelance programmer / ConsultantCommented:
I hope you realise just how .net works.  Someone codes in a .net language, that is then precompiled to an intermediate code, the intermediate code is then converted on the end user machine.
That means that code in vb.net converted to c# will precompile to identical intermediate code.  Which means zero difference in performance.

The difference for you is how good you (or your colleagues) are in vb.net and c# in terms of maintaining and writing new code.

Also bear in mind you can compile vb.net code into a dll which will run seamlessly with other code written in c# which uses that dll and the code it contains.
Dev AdminSystem Engineer | .NET Developer | Microsoft MVP | Technical SpeakerCommented:
How other write why you want convert a VB.NET project in C#?
What is the reason why you do not want to keep it in VB.NET?
zachvaldezAuthor Commented:
Great
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.