开发者

Convert Java to C# with a tool, or manually? [duplicate]

This question already has answers here: Where can I find a Java to C# converter? [closed] (9 answers) Closed 8 years ago.

I have a Java project which I'd l开发者_如何学JAVAike to convert to C#, and after looking here and elsewhere found out about a tool, Sharpen.

However, in order to get it up and running (I'm new to Java) the site linked above describes grabbing the source and building it as a plugin to the Eclipse IDE, which I'd rather not do since I don't ordinarily do Java.

Does anyone know whether a standalone EXE exists which can simply utilize Sharpen to take a given Java project and run it through the wringer to convert it to C#? Or are Java and C# similar enough that it should be pretty straightforward to just port the code over to .NET manually?


I would personally do it manually. You can reflect on where the Java design choices simply aren't appropriate for .NET, and end up with idiomatic C# code instead of code which looks very much like C# with a Java accent.

It also means you're more likely to understand the code at the end :)


There's no one-to-one conversion (or even close), so you should really do it manually. However, if you need a decent, automated piece of software, either as a starting point or as a rough converter, see this link.


If the project is so big, I would say use a tool but then review it yourself and change the stupid things in the code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜