views:

1781

answers:

15
+16  Q: 

Why use Mono?

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?

+2  A: 

in one word? Cross-platform

fmsf
Java is a more reliable cross platform language that anything provided by Mono.
ng
Yup but if you wanna code in C# out of windows you're able to :)
fmsf
@fmsf: Then your answer should go "Because you want to code in C# in Linux" and not "Cross-paltform"
OscarRyz
just for curiosity :p got 4 upvotes and 5 downvotes with that answer, yeah i know but it was to keep the answer simple :)
fmsf
Cheater. You can hyphenate anything and turn it into one word. :p
Bernard
+41  A: 

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
One of my favorite linux apps "Gnome-do" (similar to the mac Quicksilver) is written in mono. http://do.davebsd.com/
Simucal
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
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
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.
Iceman
Aha! Cletus must really just be an ultra secret alt of Jeffs!
Lone Coder
Note that F# is a slightly modified version of Objective Caml, which *can* be used natively in linux, without all that .NET crap.
slacker
A: 

Because...you want to run a .NET app? I don't understand the confusion.

Ed Swangren
Yeah, point taken, but I'm just wondering why you would choose to develop .NET code on Linux. Why not just use Java, it is much more Linux-friendly than Mono? What are specific reasons for writing C# code on Linux? Is it just the C# language itself?
Andy White
Oh, well yeah, I probably wouldn't. I think it is more for Linux users who want to use existing .NET apps. On linux I would choose Java.
Ed Swangren
In my experience, Java (especially Swing) has a lot of issues with Linux. In my next project I'm going to give Mono a go.
DavidGR
That's true, Swing definitely isn't the easiest thing to work with, on any platform.
Andy White
+5  A: 

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

Avram
+2  A: 

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.

Mystere Man
+2  A: 

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
+6  A: 

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

Jared
A: 

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.

Jess
+1  A: 

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
A: 

Why Mono rocks! ;)

Click Ok
You are begging the question.
Jeremy Roberts
A: 

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 on 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.

Yar
FWIW, I think .Net's doco sucks next to Java's. Strange.
Software Monkey
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 :)
Yar
I agree with monkey...I soooo miss java doc.
dotjoe
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.
Yar
Monkey and Joe, fixed my answer to accomodate the data :)
Yar
@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.
ShaChris23
Also, Java indeed is a single language, but the JVM has many languages going for it: Clojure, Grooby Scala just to name a few.
ShaChris23
+2  A: 

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.

Amir
A: 

How come noone has mentioned that Linux is free?

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
A: 

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
+1  A: 

Ever try to create a desktop app in java? It's like trying to give a stray cat a bath

Asher