33

What are the main benefits of using Mono over Java (or any other "free" or Linux-friendly language/runtime)?

Mono will always trail behind the latest developments in the .NET framework, why would you want to use Mono over another traditional open-source language/framework (Java)?

EDIT: Like someone mentioned below, I guess the root question is, why would you want to use .NET on the Linux platform?

vvvvv
  • 25,404
  • 19
  • 49
  • 81
Andy White
  • 86,444
  • 48
  • 176
  • 211
  • 19
    Because Mono has C# and C# isn't Java. – Rayne Feb 22 '09 at 00:11
  • 1
    Just curious, this question already got 2 downvotes, why? – fmsf Feb 22 '09 at 00:29
  • subjective and argumentative? ;) – Erik Funkenbusch Feb 22 '09 at 00:32
  • 4
    I don't think it's subjective, I just want specific reasons why you would want to "struggle" with .NET on Linux, rather than using a language that was intended to run on Linux. :) – Andy White Feb 22 '09 at 00:40
  • 2
    "Mono will always trail behind the latest developments in the .NET framework" What do you mean? Mono is already faster than MS' "official" runtime in some cases. – jrockway Feb 22 '09 at 00:40
  • 2
    I'm talking more about language features, such as LINQ, WCF, etc. When MS releases new features, there will always be a lag before Mono supports them. – Andy White Feb 22 '09 at 00:42
  • Also, there are specific features (such as MSMQ support in WCF) that may never be (cleanly) supported in Mono. – Andy White Feb 22 '09 at 00:42
  • Andy White, please excuse the crap answers you're getting here (mine included, perhaps): 1) the right people haven't seen this Q yet and 2) your question could be 20x clearer so that people know EXACTLY what you're NOT asking. Good luck. – Dan Rosenstark Feb 22 '09 at 05:50
  • No it's fine, it was a pretty crappy question. (Could be argumentative I guess). I should have been more specific. – Andy White Feb 23 '09 at 00:16

13 Answers13

62

The answer is pretty obvious: because you want to use .Net on Linux.

This of course begs the question (which I think is really what you're getting at): why would you want to use .Net on Linux (over Java)?

Lots of reasons:

  • Common code between your server and, say, a WPF or Winforms app;
  • Use of a particular .Net language, like F#;
  • Language features that aren't in Java (closures, operator overloading, partial classes, runtime generics, indexers, delegates, LINQ, var types, etc etc etc);
  • Your skills or those of your team are already in C#;
  • etc.
cletus
  • 616,129
  • 168
  • 910
  • 942
  • 2
    One of my favorite linux apps "Gnome-do" (similar to the mac Quicksilver) is written in mono. http://do.davebsd.com/ – mmcdole Feb 22 '09 at 01:02
  • 10
    Just to nitpick on the proper usage of 'beg the question': http://begthequestion.info/ . Jeff Atwood makes the same mistakes all the time in the podcasts... – Renaud Bompuis Feb 22 '09 at 02:29
  • 2
    Yes I did introductory philosophy in uni and this came up then too. The usage Jeff, I and others ascribe to the term has (like it or not) become accepted in the modern vernacular. – cletus Feb 22 '09 at 02:30
  • 3
    I like that you just begged the question (correct usage) in a conversation about your own misuse of the phrase. Well played, cletus, well played. – Kevin Apr 28 '09 at 17:06
  • Aha! Cletus must really just be an ultra secret alt of Jeffs! – Bryan Legend Mar 26 '10 at 06:46
  • Note that F# is a slightly modified version of Objective Caml, which *can* be used natively in linux, without all that .NET crap. – slacker Mar 26 '10 at 06:54
  • Does F# work in Linux? I didn't see any option for it in MonoDevelop. – NoBugs May 10 '12 at 05:05
11

Personally, i have more trust in Linux platform as server, but want to use C# as program language.

Avram
  • 4,267
  • 33
  • 40
8

You want to use C# on the iPhone, Wii, and possibly Android at some future point. See this link. http://arstechnica.com/open-source/news/2009/01/open-source-mono-framework-brings-c-to-iphone-and-wii.ars

Josh Kelley
  • 56,064
  • 19
  • 146
  • 246
Jared
  • 39,513
  • 29
  • 110
  • 145
7

Some people like C# better than Java. Also, consider that C# is an ISO standard language while Java is not. Maybe you want to run ASP.NET code on a Linux server? There's lots of reasons, really.

Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
4

I think it comes down to personal preference. I am comfortable with c#, and I want to develop apps that I can run on my Ubuntu Laptop or my Vista Laptop. Therefore, I use mono. If I were more comfortable with Java, then that's probably what I'd use.

Just my 2 cents.

Krakerjak
  • 449
  • 3
  • 7
  • 17
2

I worked for a company once whose main product was written in ASP.NET. They realized that they could probably increase their market share if they could make their product run on Linux servers. This would of course be quite difficult if not for Mono. I was given the task of spending some time seeing how much (if any) of their code would run under Mono. This would have been about 2 years ago - most of it compiled, but Mono's support for generics at the time left a little to be desired. I think its matured since then, but some of the code wouldn't even parse. The code also made use of p/invoke a bit to call native code, so that made things a little bit interesting as well. It certainly was fun trying to get it running, though.

Jeff Barger
  • 1,241
  • 1
  • 13
  • 19
2

Since Microsoft submits changes to the C# ISO standard before they make them, in theory Mono doesn't NEED to trail .NET. In reality, the big old MS budget gets to the finish line first.

Beep beep
  • 18,873
  • 12
  • 63
  • 78
2

As everybody says, "to run C# on Linux" or "to be cross-platform" or whatever.

The reason why I am interested in Mono -- and I haven't been convinced to touch it, yet -- is the possibility to take advantage of all the things that .Net has to offer that Java does not. Basically your question does come down to a Java vs. .Net comparison, and I'm not going to start running through a million points of comparison between them (in Google you'll find scores of comparisons of J2EE vs. ASP.NET, which is one part, and Java vs. C#, which is another).

But what is the big difference between .Net and Java? It has to do with the monolithic force behind .Net (Microsoft, and Novell is trying to translate that to other platforms) or the multi-vendor approach of Java. Just the process of choosing an App Server might be enough for some people to choose Mono.

What does one big monolithic vendor like Microsoft give you that Java seems to not have:

  1. Centralized documentation (was "Amazingly good documentation, all in one place" but several people have told me I'm wrong)
  2. No need to make individual platform choices (e.g., ASP.NET or ASP.NET, not servlets+JSP+JSTL?+Axis)
  3. Other stuff I am forgetting

And then there are the other massive differences: Java is a single language and Mono (I think) can run CLR-compiled code from a variety of languages.

Dan Rosenstark
  • 68,471
  • 58
  • 283
  • 421
  • FWIW, I think .Net's doco sucks next to Java's. Strange. – Lawrence Dol Feb 22 '09 at 07:19
  • Yeah, I figured that some might feel that way. We'd have to do some kind of comparison, or ask another question on SO about it :) – Dan Rosenstark Feb 22 '09 at 12:45
  • I agree with monkey...I soooo miss java doc. – dotjoe Feb 24 '09 at 17:41
  • Hmmm... could be that Java has advanced and I've been screwing around in other languages all this time :) I just remember Winforms being very well documented and the Swing Javadocs being incomprehensible. But we're talking about 2004/5. – Dan Rosenstark Feb 24 '09 at 22:23
  • Monkey and Joe, fixed my answer to accomodate the data :) – Dan Rosenstark Feb 24 '09 at 22:25
  • @yar: I think your point 1) is not right. Java does have centralized documentation too. And, I agree with other posts that Microsoft .NET documentation sucks. – sivabudh Dec 11 '09 at 23:45
  • 1
    Also, Java indeed is a single language, but the JVM has many languages going for it: Clojure, Grooby Scala just to name a few. – sivabudh Dec 11 '09 at 23:46
2

Mono is behind on some things, but way ahead on others. For example, Mono supports SSE and full ahead of time compilation - built in. On the other hand... it's going to take Mono sometime to implement all the new upcoming stuff in the upcoming .net release... for example... the quite extensive parallel libraries.

Community
  • 1
  • 1
Amir
  • 4,131
  • 26
  • 36
1

in one word? Cross-platform

fmsf
  • 36,317
  • 49
  • 147
  • 195
1

Anyone who uses Mono faces software patent danger from Microsoft.

That's why not only Mono should be avoided for new applications but also C# in first place.

Migrating to Mono only make sense if you already stuck with Windows and want to escape.

Why free software shouldn't depend on Mono or C#

Onlyjob
  • 5,692
  • 2
  • 35
  • 35
0

I have used mono as a cross-compiler, in effect. I added some "exec" lines to an existing java/ant build file to call mono as the compiler, so there was a single, complete, command line build process.

I had to write a C# wrapper layer around some PC code which our java-on-linux code base had to use, but I couldn't bring myself to require starting up Visual Studio (on a seperate computer) just to do the check-out and build process.

Roboprog
  • 3,054
  • 2
  • 28
  • 27
0

How come noone has mentioned that Linux is free?

  • 1
    Because that has nothing to do with the question. The question was not why you'd use Mono rather than .NET, but why you'd use Mono rather than something more native to Linux. – David Thornley Nov 04 '09 at 20:41