C# to VB convertor

A

a

Does anyone know a C# -> VB conversion tool? There are a lot of converters
on the web, but most of them have bugs.
 
J

Jialiang Ge [MSFT]

Hello



You may want to try Carlos's tool:

http://www.carlosag.net/Tools/CodeTranslator/



Carlos Aguilar Mares works at Microsoft. If you find any issues with the
product, please contact Carlos (the contact info can be found at the
top-right corner of the blog). I believe that Carlos will be very happy to
hear from your feedbacks.



Regards,

Jialiang Ge ([email protected], remove 'online.')

Microsoft Online Community Support



=================================================

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).



This posting is provided "AS IS" with no warranties, and confers no rights.

=================================================
 
M

Michael C

Parsa Amini said:
You can use SharpDevelop. It has a good VB, C# converter

I'd think twice about doing that as VB is definately a poorer choice.
There's various problems with it but just the intellisense being not as good
is enough.
 
P

Parsa Amini

a said:
Does anyone know a C# -> VB conversion tool? There are a lot of
converters on the web, but most of them have bugs.
You can use SharpDevelop. It has a good VB, C# converter
 
C

Cor Ligthert[MVP]

Michael,

I think that you should eat less, by eating so much you have deffinitly a
change on a hart attack.

Cor
 
M

Michael C

Cor Ligthert said:
Michael,

I think that you should eat less, by eating so much you have deffinitly a
change on a hart attack.

I'm sure I would but I think the general concensus in the dot net community
is that C# is the preferred choice. VB does have its advantages (I like the
handles keyword and creating your own events is much easier) but it missed
out on some really big show stoppers such as lack of pointers. Most of the
advantages it has are fairly minor really and just save a bit of typing but
are offset anyway by the need to type dim, directcast, next, end if,
function, sub, property, readonly etc repeatedly.

Michael
 
A

Armin Zingler

Michael C said:
I'm sure I would but I think the general concensus in the dot net
community is that C# is the preferred choice.

Wrong - and I talked to _everyone_ in the .Net community just yesterday.


Armin
 
A

Armin Zingler

Michael C said:
Why then are 70% of samples in c#?

Because there are liars out there still telling lies about VB 2008. It is a
psychological effect that you start believing something if it is told again
and again. Unfortunatelly, this has nothing to do with the truth. It makes
the 70% grow to 80%. Kinda snowball effect.

Is HD DVD really so much worse than Blu-Ray? You can not say this by looking
at the market share.

Go to a pedestrian area and start playing violin. You may have 20 listeners
a day. Then try the same and bring 5 friends with you obviously listening to
your music. Do you think you will have 25 listeners? No, you will have 100.
Is it because you've played better? No!


I admit that reintroducing Form default instances and the introduction of
the horrible My.* namespace was a "Konzessionsentscheidung" (anyone knows
the English word please?) in order to take the beginners into the boat. Very
bad design, IMO, that harbors the risk of VB being considered a beginners
language again, after all what has been achieved in the past to make it a
grown up language coping with C# head-to-head with marginal differences.

Only one fact: As long as C# is case sensitive and intellisense is one
generation behind VB's, it's not worth having another look at it. IMO.


Armin
 
T

Tom Shelton

Because there are liars out there still telling lies about VB 2008. It is a
psychological effect that you start believing something if it is told again
and again. Unfortunatelly, this has nothing to do with the truth. It makes
the 70% grow to 80%. Kinda snowball effect.

Is HD DVD really so much worse than Blu-Ray? You can not say this by looking
at the market share.

Go to a pedestrian area and start playing violin. You may have 20 listeners
a day. Then try the same and bring 5 friends with you obviously listening to
your music. Do you think you will have 25 listeners? No, you will have 100.
Is it because you've played better? No!


I admit that reintroducing Form default instances and the introduction of
the horrible My.* namespace was a "Konzessionsentscheidung" (anyone knows
the English word please?) in order to take the beginners into the boat. Very
bad design, IMO, that harbors the risk of VB being considered a beginners
language again, after all what has been achieved in the past to make it a
grown up language coping with C# head-to-head with marginal differences.

Only one fact: As long as C# is case sensitive and intellisense is one
generation behind VB's, it's not worth having another look at it. IMO.

I would argue that since 2005, the intellisense in C# is >= then VB's. In
fact, I would argue that the entire C# IDE experience is better. It's a lot
of little things.

In C# when I type in a class name in a referenced dll but there is no
using statment for it - it puts a little underline and hitting ctrl+. will
bring up a menu that lets me add the using or qualify the class name. VB.NET
does the same thing, BUT it doesn't do it until you hit enter, so you have to
jump back to your line or use the mouse. Yuck.

Actually, that's my big complaint - all of the little auto suggest things
(like implementing an abstract base class or interface) the all do the same
thing. Again, Yuck.

As for case sensitive - I love it. Of course, with auto implement properties,
i don't usually create a lot of fields anymore:

public class MyClass
{
public MyClass ()
{
MyName = string.Empty;
}

public MyClass (string name)
{
MyName = name;
}

public string MyName {get; set;}
}
 
M

Michael C

Armin Zingler said:
I admit that reintroducing Form default instances and the introduction of
the horrible My.* namespace was a "Konzessionsentscheidung" (anyone knows
the English word please?) in order to take the beginners into the boat.
Very
bad design, IMO, that harbors the risk of VB being considered a beginners
language again, after all what has been achieved in the past to make it a
grown up language coping with C# head-to-head with marginal differences.

That's the problem with a lot of these VB features, if you're in a team
environment then some idiot will use them. Especially if, like me, you come
to a project later and have to clean up other people's mess. If they were
using C# it certainly wouldn't eliminate all their bs but at least it would
cut it down significantly.
Only one fact: As long as C# is case sensitive and intellisense is one
generation behind VB's, it's not worth having another look at it. IMO.

I was against case sensitivity for years but after using C# I quite like it.
I think the reason a lot of people don't like it is because of the
possibility of misusing the feature, eg declaring a variable of i and I in
the same routine. The ironic thing is that VB has so many features that can
be misused (eg the With statement gets a complete hammering in a lot of VB
code) yet they dislike case sensitivity simply because it might get misused.
I generally don't use it except in cases where I need to call shared
(static) methods and have called an instance variable by the same name as
the type, eg

Dim mt as new MT()
mt.DoSomething()
MT.DoSharedMethod()

I guess this is why they allowed calling shared functions from an instance
which is another feature that VB would be better without.

As for the intellisense I'm very suprised you would say C# is behind VB. I
find the VB intellisense annoying and feel like they got it just a little
bit wrong. The reasons are fairly solid reasons and more than just a matter
of opinion.
1) Whenever you select a control name, eg txtWhatever, the intellisense
always goes to the first event handler, eg txtWhatever_KeyDown. In all my
years of programming I've never called an event so always have to scroll up
one.
2) Instead of moving to the required item in the list, the list gets smaller
as I type. If I mistype a single characters then the list usually
disappears. I then have to backspace until the list reappears and select the
item I want. In comparison the list in C# does not get smaller and does not
disappear so usually when I mistype I can see the item I want in the list
and select it.
3) Because of 2 when you push backspace intellisense appears.
4) Intellisense seems to popup more often when it is not wanted and I find
myself pushing esc all day. In comparison intellisense in c# seems to appear
more in line with when I want it. I'd have to be in front of my work PC to
fully work out what's going on here.

Cheers,
Michael
 
M

Michael C

Michael C said:
As for the intellisense I'm very suprised you would say C# is behind VB. I
find the VB intellisense annoying and feel like they got it just a little
bit wrong. The reasons are fairly solid reasons and more than just a
matter of opinion.
1) Whenever you select a control name, eg txtWhatever, the intellisense
always goes to the first event handler, eg txtWhatever_KeyDown. In all my
years of programming I've never called an event so always have to scroll
up one.
2) Instead of moving to the required item in the list, the list gets
smaller as I type. If I mistype a single characters then the list usually
disappears. I then have to backspace until the list reappears and select
the item I want. In comparison the list in C# does not get smaller and
does not disappear so usually when I mistype I can see the item I want in
the list and select it.
3) Because of 2 when you push backspace intellisense appears.
4) Intellisense seems to popup more often when it is not wanted and I find
myself pushing esc all day. In comparison intellisense in c# seems to
appear more in line with when I want it. I'd have to be in front of my
work PC to fully work out what's going on here.

I forgot number 5 which is when I type "public readonly property" the
intellisense shows readonly and property but for some reason they are not
selected and I have to down arrow 1 to select each of these. This is
annoying consider both keywords are not required in C# at all.

Michael
 
C

Cor Ligthert[MVP]

Michel,

Although that you took the subject Event Handler, you did not write how an
eventhandler has to be set in C# and in VB.

Maybe you can tell us in which way C# outclasses VB in that so we can laugh
even more here.

Cor
 
M

Michael C

Cor Ligthert said:
Michel,

Although that you took the subject Event Handler, you did not write how an
eventhandler has to be set in C# and in VB.

Maybe you can tell us in which way C# outclasses VB in that so we can
laugh even more here.

What a pity, your reply above in the other thread was mature and
intelligent, then you go and ruin it here with this childish rant. You
didn't answer a single one of my points and ran off on a tangent.

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Free C# to VB converter? 1
code convertor in VB.NET Express Edition 4
Converting C++ to C# 1
convert _VBA_ to VB.net? 16
Laptop mites? 3
C# code to VB? 4
Convert VB.NET Code To C# 3
Convert C to VB 2

Top