2

I have done a lot of research regarding this issue. but i am still confused in choosing the right programming language. I wanted to convert my system which is programmed using C# to a cross platform system. Even though c# is an cross platform language the mono project is not successful according to my research.

Please give me your suggestions to this problem? I believe c++ and java will be an ideal programming language but java doesn't provide good GUI and if i choose c++ i will get stucked when converting my dll to c++.

Please provide your suggestions. Thank you.

Navin
  • 554
  • 2
  • 9
  • 31
  • Hehe... you've successfully developed a cross-platform project that works on all sufficiently modern Windows platforms :-) – Kerrek SB Feb 26 '12 at 10:03
  • 3
    Who said "*Java doesn't provide good GUI*". There are several very slick Java/Swing UIs out there. –  Feb 26 '12 at 10:08
  • 3
    What research have you done to say that Mono is not successful? Most of the time you can just copy the compiled exe to a Linux box, install Mono from your package manager, and run `mono myproject.exe` and not experience any issues. Even if you're using P/Invoke, as long as there's a Linux-equivalent .so or OS X equivalent .dylib, you can easily get it to run on Mono by using `dllmap`. – Robert Rouhani Feb 26 '12 at 10:12
  • Keep in mind, Java is write once, debug everywhere. If you use boost and/or a good UI lib, you at least have a fighting chance that things will work as designed with C++ and a fairly large pool of programmers to draw from. – JimR Feb 26 '12 at 10:22
  • 4
    @Robert In my experience: Mono may support most language features of C#, but it's a completely different thing on the library side. I think they even stated they're not planning to add support for WPF,.. – Voo Feb 26 '12 at 10:35
  • @Voo A large portion of the BCL is exactly the same as Microsoft's implementation. Even the GDI+ based `System.Drawing` classes all work just fine. The only major thing that are not planning on implementing is WPF ([they've already stated they don't have the manpower to create the same system and make it cross-platform in a reasonable timeframe](http://tirania.org/blog/archive/2011/Mar-07.html)). – Robert Rouhani Feb 26 '12 at 11:04

4 Answers4

5

Since Java syntax is a lot like C# syntax it would be easier to convert the code to Java. And there are actually some nice GUI libraries for Java.

See which-gui-library-is-the-best-in-java (Deleted in the meantime but Swing and SWT were favoured there)

Community
  • 1
  • 1
juergen d
  • 201,996
  • 37
  • 293
  • 362
  • 2
    i.e. if you don't like the standard GUI, there are others. BTW: IntelliJ uses swing and I am quite happy with in. – Peter Lawrey Feb 26 '12 at 10:07
  • Thank you juergen and peter. but is it possible to get the native look and feel using the GUI libraries you'll mentioned ? – Navin Feb 26 '12 at 10:24
  • Swing has a pretty native look IMHO. But why does it need to look like Windows style exactly? – juergen d Feb 26 '12 at 10:43
  • "*is it possible to get the native look and feel"* Try it in the [Nested Layout Example](http://stackoverflow.com/a/5630271/418556) which offers the native PLAF as one of the choices. – Andrew Thompson Feb 26 '12 at 11:02
  • I ment SWT not Swing in my previous comment. – juergen d Feb 26 '12 at 11:16
3

I don't know what you mean by a good GUI, but you could use SWT which gives native integration to file/Open dialog boxes etc, rather than using the Java ones.

Of course a lot depends on how cross paltform you need it to be. Some devices only support C.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
1

"cross platform" is not a fixed term. For example: Using the Eclipse RCP you have SWT on board. Your code uses the RCP stuff and would be platform neutral. But the embedded SWT libs would require either per-platform installable packages or one big package containing the SWT libs for all supported platform. If this is OK for you, you could use Java+SWT+(anything else you want) and have nice GUIs.

A.H.
  • 63,967
  • 15
  • 92
  • 126
  • Thank you A.H. but is it possible to get the native look and feel using the GUI libraries you'll mentioned ? – Navin Feb 26 '12 at 10:24
1

There is NO truly cross-platform language or technique. Yes, Java and Python can provide some abstraction over a platform... But everything stuck if only you add ":" to your file-name.

I mean, creating a software that is truly runs on many platform is FAR more than only choosing between Java, C# and C++. If one developed such software, one would understand me...

There is NO problems with Mono if you consider Mono as a target platform from the beginning. The most problems with mono happens when something is already written in .NET without ever aimed to be run on Mono. In this case there could be problems. If you bare in mind Mono from the beginning it is still the excellent platform.

As something that wasn't suggested here yet, I could refer you using python with Glide as cross-platform solution of creating applications with GUI.

Or you can see the Vala GObject system. Which syntax is really C# alike.

MajesticRa
  • 13,770
  • 12
  • 63
  • 77