Why use Mono? [closed]

2019-03-08 18:32发布

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?

13条回答
ゆ 、 Hurt°
2楼-- · 2019-03-08 19:16

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.

查看更多
干净又极端
3楼-- · 2019-03-08 19:18

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.
查看更多
地球回转人心会变
4楼-- · 2019-03-08 19:18

How come noone has mentioned that Linux is free?

查看更多
We Are One
5楼-- · 2019-03-08 19:21

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.

查看更多
迷人小祖宗
6楼-- · 2019-03-08 19:22

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.

查看更多
戒情不戒烟
7楼-- · 2019-03-08 19:23

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.

查看更多
登录 后发表回答