views:

3451

answers:

15

How much less libraries are there for Mono than for Java?

I lack the overview over both alternatives but I have pretty much freedom of choice for my next project. I'm looking for hard technical facts in the areas of

  • performance (for example, I'm told Java is good for threading, and I hear the runtime code optimization has become very good recently for .NET)
  • real world portability (it's both meant to be portable, what's Catch-22 for each?)
  • tool availability (CI, build automation, debugging, IDE)

I am especially looking for what you actually experienced in your own work rather than the things I could google. My application would be a back-end service processing large amounts of data from time series.

My main target platform would be Linux.

Edit: To phrase my question more adequately, I am interested in the whole package (3rd party libraries etc.), not just the language. For libraries, that probably boils down to the question "how much less libraries are there for Mono than for Java"?


FYI, I have since chosen Java for this project, because it seemed just more battle-worn on the portability side and it's been around for a while on older systems, too. I'm a tiny little bit sad about it, because I'm very curious about C# and I'd love to have done some large project in it, but maybe next time. Thanks for all the advice.

+8  A: 

I think the question is phrased incorrectly. C# vs. Java is much less interesting in terms of cross-platform usage than is (a) which platforms you need to support, and (b) considering the core libraries and available third party libraries. The language is almost the least important part of the decision-making process.

Brad Wilson
Agreed. It's a matter of how well supported the virtual machines are on various architectures.
Allain Lalonde
Agreed. No fun in doing a full development if the customer cannot run it.
Thorbjørn Ravn Andersen
+47  A: 

Well....Java is actually more portable. Mono isn't implemented everywhere, and it lags behind the Microsoft implementation significantly. The Java SDK seems to stay in better sync across platforms (and it works on more platforms).

I'd also say Java has more tool availability across all those platforms, although there are plenty of tools available for .NET on Windows platforms.

Ben Collins
I'am really glad to read this and joyfull about the votes in a Microsoft world. .NET is really good but Java have a legitimity as I always tried to explain as a .NET developper and an old Java one ;)
JoeBilly
+19  A: 

Java actually is as cross-platform as everyone says it is. There's a JVM implementation for just about any mainstream OS out there (even Mac OS X, finally), and they all work really well. And there's tons of open source tools out there that are just as cross platform.

The only catch is that there are certain native operations you can't do in Java without writing some DLLs or SOs. It's very rare that these come up in practice. In all those cases, though, I've been able to get around it by spawning native processes and screen-scraping the results.

jodonnell
Also, in pretty much every case where Java can't do a native operation in a cross-platform manner, the same will be true for .NET
Eli Courtwright
Finally? Mac OS X has had a JVM implementation since 10.0. :)
mipadi
+22  A: 

I actually develop in .NET, run all my tests first on Mono, and then on Windows. That way I know my applications are cross platform. I have done this very successfully on both ASP.NET and Winforms applications.

I am not really sure where some people get the impression Mono is so horrible from, but it certainly has done it's job in my cases and opinions.It is true you will have a bit of lag for the latest and greatest inventions in the .NET world, but so far, .NET 2.0 on Windows and Linux is very solid for me.

Keep in mind there are obviously many quirks to this, but most of them come from making sure you are writing portable code. While the frameworks do a great job of abstracting away what OS you are running on, little things like Linux's case sensitivity in paths and file names takes a bit of getting used to, as do things like permissions.

.NET is definitely very cross platform due to Mono based on my experiences so far.

Geoffrey Chetwood
Call me ignorant, but do you even need to test ASP.NET with mono? Everything that would be .NET is server side, thus is doesn't matter which OS it's displayed on does it?
Ethan Gunderson
Ethan, using Mono you can host ASP.net apps on Linux.
Eric Haskins
EHaskins, I think what Ethan was getting at is that why bother making it cross platform for ASP.NET when you control the server... just run it on Windows... Fogbugz type applications would be an exception (with possibility to run on client's server)
Mike Stone
Not everyone wants to run their app on Windows, for whatever reason.
Bernard
One problem with Mono lagging behind the MS implementation is when you have major API changes (.NET 3.5 with W?F, for example). By the time you get there in Mono, you're so far behind the rest of the world, you may be less competitive (not always the case, but one of the risks of being behind).
Ben Collins
@Ben Collins: I don't really believe that is a valid argument.I would always recommend to a developer to stay up to date with the newest frameworks, but I would never recommend they start using those new frameworks in production code without some latency. Frameworks have their problems after all...
Geoffrey Chetwood
@mike Stone: When trying to stay competitive, you will sometimes find clients who do not have or do not wish to have MS products in their server racks. I cannot say I agree, but I can certainly respect their wishes. Therefore, being able to run my apps on Linux is a large benefit.
Geoffrey Chetwood
@Rich B: this discussion is about portability, not best practices for using frameworks in production code. The fact is that there are more up-to-date implementations of java across more platforms than .NET. I've got nothing against .NET, but it just can't compare to Java in portability.
Ben Collins
@Rich B: if a client doesn't want MS products, .NET is clearly the wrong choice.
Kjetil Ødegaard
@Kjetil: Mono is not an MS product.
Geoffrey Chetwood
+4  A: 

Java was designed to be cross-platform; C#/.Net wasn't. When in doubt, use the tool that was designed for your purpose.

EDIT: in fairness, .NET was designed to work on embedded/PC/Server environments, so that's SORT of cross-platform. But it wasn't designed for Linux.

AlexeyMK
well, the C# is ISO standardized, so the idea was to have something cross-platform. microsoft didn't want to develop implementations for other platforms, but it's left to other parties as the language is a standard.the .Net framework is a more complicated story, though.
zappan
Mono is a good implementation though and DotGNU (for Mac too)
Andrei Rinea
zappan: valid point on C# (didn't know), but .NET is freaking huge. Admittedly I have no personal experience here.
AlexeyMK
+4  A: 

I'm going to say Java as well. If you look at it in terms of maturity, a lot more time and effort has been expended by Sun (and others) in getting the JVM to work on non-Windows platforms.

In contrast, Mono is definitely a second class citizen in the .NET ecosystem.

Depending on who your target customers are, you may also find there is real pushback against using Mono - does Novell offer the same kind of vendor support for Mono that you would get for Java or .NET on Windows?

If you were primarily targeting hosting your service on Windows, it would make sense to be considering this choice, but since you're targeting Linux primarily, it seems like kind of a no-brainer to me.

warren_s
+2  A: 

There are other language choices too. I've become quite fond of Python, which works well on Windows, Linux, and Mac, and has a rich set of libraries.

George V. Reilly
Yeah, I love Python and it has Django which I like for web apps, but there were some things that made it inacceptable, the most important being the GIL in the standard C implementation of the interpreter. I have a number of operations that benefit greatly from parallel computing on multicore machines and I'd have to spawn processes to do that in cPython.
Hanno Fietz
+2  A: 

I would vote for Java being more portable than C#. Java definitely also has a very rich set of standard libraries. There is also a broad set of open source 3rd party libraries out there such as those provided by the Jakarta project (http://jakarta.apache.org/).

All the usual suspects exist for CI, Unit testing, etc too. Cross platform IDE support is also very good with the likes of Eclipse, Netbeans, IntelliJ IDEA etc.

+3  A: 

To add a bit more to the conversation, Java is more portable if you remain about one version behind - Java 5 still has many excellent features so you can wait for Java 6 and still have a lot of range in terms of language and libraries to develop with. The Mac is the primary platform that can take some time to catch up to the latest Java version.

Java also has an excellent standards body that intelligently grows the platform based on input from many different companies. This is an oft overlooked feature but it keeps even new features working well across multiple platforms and provides a lot of range in library support for some esoteric things (as optional extensions).

Kendall Helmstetter Gelner
OS X 10.6 has now fully catched up with the Sun Java 6 release.
Thorbjørn Ravn Andersen
+7  A: 

I've been asking the same question off-late and IMHO, .NET/Mono seems to be a better option simply because Mono has a great track record for cross-platform desktop applications (as opposed to Java) and of course, Mono is improving by leaps and bounds these days.

Swaroop C H
+3  A: 

I think the answer is "it depends." Java runs on just about anything, but .NET/Mono are (IMHO) a better framework for the desktop. So I guess the answer really depends on what platforms you plan on targeting.

Giovanni Galbo
+2  A: 

While Mono has its share of problems I think it has a better cross-platform compatibility story especially IF you have reliance on native platform invocation.

There are not enough words on Stack Overflow to stress how much smoother it is to get something native called and executed in .NET/Mono on (at least in my experience 3...) multiple platforms vs. the equivalent Java effort.

damageboy
A: 

I think Mono is a hoax. I mean everyone talks about it, but who is actually using it. I see that someone is using it for testing to make sure it works in Mono but who actually runs .NET code on a linux box.

Mono is just there so that .NET developers ( myself included) can claim that just like Java its cross platform.

Obviously I am joking about it being a hoax but you get the idea.

Brian G
I think that's a question of maturity. Recently, Mono has drawn a lot more attention and is being featured in Linux developer magazines. After all, it has a target audience similar to Java's. For me, it was by all means a totally valid option.
Hanno Fietz
There is a huge amount of applications out there written in .NET for Linux. Novell of course did a bunch of them, but they are not the only ones. As a good example of an excellent cross platform application look at tomboy.
Anders Rune Jensen
+1  A: 

Linux - Python, Java, Pike.

$Windows - C# if it work :<

+4  A: 

Java is a better choice for Cross-Platform development.

  • Performance. Java and .Net have similar performance level due to the virtual machine, but JVM normally has better performance because of years and years optimization.

  • Library. Although this depends on your task, Java has much more open source or third party libraries available there. For server App, J2EE, Spring, Struts, etc. For GUI, although .Net provides Win32 layer API but this causes compatibility issues. Java has Swing, SWT, AWT, etc. It works in most cases.

  • Compatibility. This is the key issues that need to be considered when develop the cross-platform program. Two issue: first, platform compatibility. Java still wins since JDK is well maintained by single and original company Sun. Mono is not maintained by MS, so you have no guarantee yet for update compatibility. 2. Backward compatibility. Sun maintains a good reputation on their backward compatibility, although sometimes this seems too rigid and slows the pace.

  • Tools. Java has good cross-platform IDEs. Netbeans, Eclipse, etc. Most of them are free. VS Studio is good but only on Windows, and not cost a bit. Both of them provides good unit tests, debugs, profiles, etc.

Hence I'd suggest that Java is a better choice. As a show case, there are some famous desktop cross-platforms apps developed by Java: Vuze, Limewire, BlogBridge, CrossFTP, not to mention those IDEs. As to .Net, I have limited knowledge on such success apps.