Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Java Programming

C# to Java Conversion? 8

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.
This discussion has been archived. No new comments can be posted.

C# to Java Conversion?

Comments Filter:
  • by Anonymous Coward
    C# is going to be a language used to bind COM & COM+ components together to create applications and add-ins. In most cases, the converted code will be useless without the same components being available for the other platform.

    Given Microsoft's recent track record, good luck even trying to distribute a C# application on anything but the development machine on which it was written.
  • Given that C# is currently nothing but a specification, and an incomplete one at that, what is it that you are converting? The syntax? That's trivial, but for a couple of things that wouldn't map well, like unsafe and pointer arithmetic. But given that the language is going to be wedded to COM for all its functionality, you'd have to go a long long way to generate Java to do all that. If a C# program calls an Excel automation interface, what are you going do? (Well, I know a pointer to a beginning of a solution -- use the JIntegra Java-COM bridge, but that's just a pointer).

    BTW I totally 2nd the poster who comments on how C# is not search-engine compliant. I presume the alternates of C-sharp and Csharp would become the preferred variants for searchable text, but really. I think I'll invent a language and call it /.:+!
  • If you are considering between Java and C++ for a large project, I'd suggest that you use C++, at least until Java has matured a bit.
  • 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

  • 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#.
  • 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.
  • by jerdenn ( 86993 ) <jerdenn@dennany.org> on Monday July 10, 2000 @05:34PM (#944334)
    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

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...