Slashdot Mirror


C# to Java Conversion?

axlrosen asks: "Given Microsoft's current prerelease C# spec, would it be possible to write an automatic converter from C# to Java? Are there any parts of the language that couldn't be converted? Could the 'unsafe' stuff be converted to a combination of Java and C++, using JNI?" Of course something like this is possible, but is it practical at this point? C# is a very new language, and I wouldn't advise starting any serious projects with it until the language has been through its paces. If you are considering between C# and Java for a large project, I'd suggest that you use Java, at least until C# has matured a bit.

4 of 8 comments (clear)

  1. your missing the point of C# by josepha48 · · Score: 2
    I think the reason that Microsoft went with this C# is to make Java Obsolete. If I understand C# correctly it is basically going to offer you some of the features of Java & VB ie Objects, Inheritance, etc, but with the speed and contraol you get with C or C++. I don't think Microsoft would create C# to be portable. They are not like that, just look at there VB, the MFC and J++. If C# is as easy to program as Java many windows programers will have an easier time dealing with COM/DCOM.

    Java is supposed to be cross platforms, but it does not work this way all the time. There are so many different versions of the JDK and they have so many incompatibilities, which Java version would the C# to Java convert to anyway? What would it buy you to convert to Java when there would probably be COM/DCOM or COM+ code in there too?

    send flames > /dev/null

    --

    Only 'flamers' flame!

  2. Short answer: no. by rjh · · Score: 2

    C# permits pointers (and everything associated with them) and the disabling of garbage collection. Neither of these can be duplicated in Java. It might be able to implement a subset of C# which would be more Java-friendly, but not the full set of C#.

  3. C# is search engine anti-friendly by mdaniel · · Score: 3

    Has anyone else noticed that you can't search for the name "C#" on 85% of the search bots for websites? (I am not talking about the engines like google - I haven't tried them)

    I find it especially funny that you can't use "C#" on search.microsoft.com, either.

  4. Why ? by jerdenn · · Score: 3
    My question is why?

    Looking at the language specs, it appears that C# is Microsoft's answer to the in-between language that many Windows programmers have been asking for some time now. There are some projects that don't really need the power (or complexity) of C++, but VB often overdoes it in the effort to oversimplify and kludge everything together.

    I welcome an easier way to program COM/DCOM/COM+ on windows platforms - There are times when I require C++ for its speed and control, but I sacrifice developement time to gain this. A middle ground is much needed.

    That having been said, why would we need to port a project to java?

    I think the question misunderstands the intended domain for the C# language - A COM-based developement environment.

    -jerdenn