Use the automatic code converters at developerFusion to convert C# code into Visual Basic, Ruby, and Python

[code converters]

The developerFusion web site provides code converters that let you translate between C#, Visual Basic, Ruby, and Python.

One of the most important uses for reflection is analyzing code to figure out what it does. Once you know what the code does, you can emit new code to do the same thing in a different programming language. That’s what these code converters do. (Although right now they seem to be having trouble.)

The site has a tools page with links to free web-based tools that convert between C#, Visual Basic, Ruby, and Python. The tools are:

The results are pretty good, although the languages do not provide exactly the same features so the results aren’t necessarily perfectly equivalent. For example, Visual Basic’s Select Case statement is more flexible than C#’s switch statement, so the tools cannot always perform a round trip conversion from Visual Basic to C# and back. For specific examples, it converts Case 0 To 9 into a series of 10 C# case statements and it cannot handle statements such as Case Is < 0, Is >= 30. (It should probably convert these kinds of Select Case statements into sequences of if-then-else statements instead if trying to use a switch statement.)

Overall, however, the results are reasonably good, can give you a big head start if you need to translate a lot of code, and are free.


Follow me on Twitter   RSS feed   Donate




This entry was posted in programs, reflection, syntax and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.

5 Responses to Use the automatic code converters at developerFusion to convert C# code into Visual Basic, Ruby, and Python

  1. Angel says:

    Very good idea, at this moment it’s great for me. As I have not been able to evaluate developerFusion since the translation does not work at this moment, I have searched for alternatives and https://codeconverter.icsharpcode.net/ works very well for me. Thank you

  2. Rajat says:

    I have tried to convert a simple “Hello World” code of C# into python but nothing happened. It is just showing processing for last 12 hours.

    Any solution?

  3. dani kataya says:

    is there any good convertor for c++ to c#?
    and for fortran 77 fixed format to c#?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.