Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello everyone,

I have a project coded in VB 6. I need to support unicode. To do this, as I understand, I need to convert VB 6 code to either in to VB.Net or C#. So, I have two options

a) Convert VB 6 to VB.Net
b) Convert VB 6 to c#

I would like to know which option is beter to choose and why?


My VB 6 application uses controls like datgrids, textboxes , buttons etc and populates values into these contols from SQL database.

Any help will be apreciated.

Regards,
joy
Posted

The functional differences and differences in expressive capabilities between C# and VB.NET are very minor. You can easily do translations between them automatically. Well, usually, when languages grow, C# goes a step ahead of VB.NET.

However, there is a big cultural difference. As, in public opinion, VB.NET is still associated with the notion "Visual Basic" or "Basic", it's very typical that software developers who consider themselves serious developers, don't consider VB.NET as something serious. VB.NET strongly repels skillful or just ambitious people, no matter why, and it attracts people who feel somewhat uncomfortable in programming and think that "Basic" is supposed to be "easier" (not clear why). Naturally, same thing happens in Microsoft: C# is a flagship product, and VB.NET is supported rather to keep the position on the market targeted to the developers who have the habits of developing on Basic. C# and C++/CLI are the subject of standardization, under ECMA, but I cannot imagine VB.NET to be standardized.

If of course has some practical implications. If you seek for help or for some available open-source .NET code, it's much easier to find something in C#. Things like that…

—SA
 
Share this answer
 
Comments
Maciej Los 16-Dec-13 10:06am    
A5!
Sergey Alexandrovich Kryukov 16-Dec-13 10:10am    
Thank you, Maciej.
—SA
The "mechanics" of the conversion are the same whichever language you choose: .NET controls are different from VB6 controls, so it is unlikely that you can keep much (if any) of your current UI code base without massive amounts of testing and probably headaches.

Having said that, there are automated conversion tools which will convert the code to VB or C# for you - a very quick google found this: VBUC[^] though I haven't used it myself.

Personally, I would probably hand re-develop it in C# if only because it removes the temptation to use "old" and incompatible VB6 coding methods with VB.NET - if you have to do it in C# then you will end up with a C# solution. If you go VB6 to VB, then you could easily end up with a "mashup" that suits neither language.

Depends on you though: How familiar are you with C#?
 
Share this answer
 
Comments
Maciej Los 16-Dec-13 10:06am    
A5!
Let me start by saying I'm an out-and-out C sharp programmer, and I love the language. I've done some VB6 so I at least am familiar with the world you're coming from. So, it would be tempting to say "go C sharp." But I also have a friend I respect who swears by VB.

Realistically, there are more serious considerations - such as the timeframe you have for making the conversion, your own goals regarding learnign a new programming language, whether you are the sole developer of the application, and if you are or will be part of a team, what is the language the team has the most experience with.

Both languages will cope with the UI elements you have to use; if you use a third-party set of UI controls you might take a look and see if they support both VB.Net and C sharp (I see no reason why not since a control is just code in a .Net assembly - and that can be referenced equally by both languages). Similarly, both languages use the same .Net framework, so they both have the same access to SQL database as each other. And, using those framework elements, whether from VB.Net or C sharp, will be an identical learning curve.

I'd say you are probably better off moving to VB.Net because on that path you only have to learn the delta between VB6 and VB.Net, not the whole of a new language.

You should take a look at http://www.red-gate.com/products/dotnet-development/reflector/[^] and look at how it can disassemble a .Net assembly into any of several .Net languages. You should also google tools that might help with your conversion. The availability of a suitable tool might help influence your decision.
 
Share this answer
 
Comments
Maciej Los 16-Dec-13 10:06am    
A5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900