Switching from C# to Java: Coding the Cross Platform Solution

Discussions

News: Switching from C# to Java: Coding the Cross Platform Solution

  1. Two and a half developers, a short 4 month time frame, over 100k lines of C# code, and it all needs to be made cross platform. How do you do it? Well, Linvat Peer will tell you how they did it in the following post:

    Threaded Messages (12)

  2. C# to Java Converter[ Go to top ]

    For those too lazy to read the full article, they used this C# to Java Converter.
  3. C# to Java Converter[ Go to top ]

    For those too lazy to read the full article, they used this C# to Java Converter.

    And submit 200+ bugs and modify the C# code because it was not converting properly.
  4. Going the other way[ Go to top ]

    I've done the opposite going from Java to C#. One good thing about Java and C# being so similar is that code conversion can tackle a lot of it. As long as the developers try to stay away from platform specific stuff, the conversion isn't bad. Atleast that's my experience with porting my rule engine from java to C#.
  5. Going the other way[ Go to top ]

    I've done the opposite going from Java to C#. One good thing about Java and C# being so similar is that code conversion can tackle a lot of it. As long as the developers try to stay away from platform specific stuff, the conversion isn't bad. Atleast that's my experience with porting my rule engine from java to C#.
    I would think that going from Java to C# would be easier since C# is more like a superset of Java.  There's also J++ in the .Net ecosystem that looks a lot like Java but I'm not clear on what exactly it is.
  6. Going the other way[ Go to top ]

    I've done the opposite going from Java to C#. One good thing about Java and C# being so similar is that code conversion can tackle a lot of it. As long as the developers try to stay away from platform specific stuff, the conversion isn't bad. Atleast that's my experience with porting my rule engine from java to C#.
    I would think that going from Java to C# would be easier since C# is more like a superset of Java.  There's also J++ in the .Net ecosystem that looks a lot like Java but I'm not clear on what exactly it is.

    I would say that is true if the code sticks to core java api. once you get into javax and other stuff, it becomes rather painful. Things like concurrent collections is just coming out in .NET 4.0, so there's quite a few areas where .NET is behind. That's just my experience.
  7. Going the other way[ Go to top ]

    what about conversion of annotations?  Esp. stuff like Spring, Hibernate or Seam-specific annotations?
  8. Going the other way[ Go to top ]

    It is J#. It is dead. Better to just go to C#. J++ the old Microsoft "Java". Way back when.
  9. Going the other way[ Go to top ]


    To run Java on .NET use IKVM.

    Here is the list of unsupported jars (basically AWT/Swing and audio/imaging).
    I have used it for multithreaded async web server using Jetty, JAXB, etc. - no problem.

    IKVM rocks !

    Mik
  10. Going the other way[ Go to top ]


    To run Java on .NET use IKVM.

    Here is the list of unsupported jars (basically AWT/Swing and audio/imaging).
    I have used it for multithreaded async web server using Jetty, JAXB, etc. - no problem.

    IKVM rocks !

    Mik

    I agree IKVM rocks, but sometimes it's better to port over if you want it to look like C# code and use .NET specific stuff. IKVM also gives you the ability to statically compile it to a dll, instead of running IKVM.
  11. I've just done this. I don't know how many lines of code it was. A lot.
    But I had to rewrite it.  Had no choice with the GUI because i went from Winforms to Eclipse RCP (the main reason i switched). I used NHibernate but eliminated a lot of code when using Spring + Hibernate. Plus i am using Spring remoting which i had not done before.  The only code i could really reuse was the iText code. That I just cut and pasted then fixed the Properties vs Setter/Getter issue and method upper vs lower case.  

    I should probably see how many lines because I did it myself and I didn't work on it full time. But i think it would not have been more than 4 months (40 x 7)

    Having done plenty of C# and Java, Trying to auto convert code should be kept to a minimum. And only if you have use "common" libraries.
  12. I' don't know how many lines of code it was. But we should reduced by using Hibernate and struts and spring. This is the main reason for migrate to here. It delegate all these comlecated coding and it isolated in sub-part.
  13. If you want to switch from c# java you can try this tool convert c# code to java its free and very reliable and convert your code very fast.