developer tip

.NET / Mono 또는 Java가 크로스 플랫폼 개발에 더 적합한 선택입니까?

optionbox 2020. 8. 8. 12:28
반응형

.NET / Mono 또는 Java가 크로스 플랫폼 개발에 더 적합한 선택입니까? [닫은]


Java보다 Mono 용 라이브러리가 얼마나 적습니까?

두 가지 대안에 대한 개요가 부족하지만 다음 프로젝트를위한 선택의 자유가 거의 있습니다. 나는 분야에서 어려운 기술적 인 사실을 찾고 있습니다.

  • 성능 (예를 들어, Java가 스레딩에 좋다고 들었는데 최근에 .NET에서 런타임 코드 최적화가 매우 좋아 졌다고 들었습니다)
  • 실제 이식성 (둘 다 이식성을 의미하며 각각의 Catch-22는 무엇입니까?)
  • 도구 가용성 ( CI , 빌드 자동화, 디버깅, IDE)

나는 특히 내가 구글 할 수있는 것보다 당신이 실제로 당신의 작업에서 경험 한 것을 찾고있다. 내 애플리케이션은 시계열에서 대량의 데이터를 처리하는 백엔드 서비스입니다.

내 주요 타겟 플랫폼은 Linux입니다.

편집 : 내 질문을 더 적절하게 표현하기 위해 언어뿐만 아니라 전체 패키지 (타사 라이브러리 등)에 관심이 있습니다. 라이브러리의 경우 "Java보다 Mono에 라이브러리가 얼마나 적은가"라는 질문으로 귀결 될 수 있습니다.


참고로, 저는이 프로젝트를 위해 Java를 선택했습니다. 이식성 측면에서 더 낡은 것처럼 보였고 이전 시스템에서도 한동안 사용 되었기 때문입니다. 나는 C #에 대해 매우 호기심이 많고 그 안에 몇 가지 큰 프로젝트를 수행하고 싶기 때문에 조금 슬프다. 모든 조언에 감사드립니다.


음 .... Java는 실제로 더 이식성이 있습니다. Mono는 모든 곳에서 구현되지 않으며 Microsoft 구현보다 크게 뒤쳐집니다. Java SDK는 여러 플랫폼에서 더 나은 동기화 상태를 유지하는 것 같습니다 (더 많은 플랫폼에서 작동 함).

Windows 플랫폼에서 .NET에 사용할 수있는 도구가 많이 있지만 Java는 모든 플랫폼에서 더 많은 도구 가용성을 제공한다고 말하고 싶습니다.

2014 년 업데이트

저는 2014 년에도 여전히이 의견을 가지고 있습니다. 그러나 저는 오랫동안 실제로 신경 쓰지 않고 Mono에 약간의 관심을 기울이기 시작 했으므로 Mono 런타임 (또는 에코 시스템)에 개선이있을 수 있습니다. ) 내가 알지 못했습니다. AFAIK, WIF의 WPF, WCF, WF는 아직 지원되지 않습니다. Mono는 iOS에서 실행할 수 있지만 내가 아는 한 Java 런타임은 여전히 ​​Mono보다 훨씬 많은 플랫폼에서 실행됩니다. 또한 Mono는 훨씬 향상된 도구 (Xamarin)를보기 시작했으며 Microsoft는 파트너와 경쟁하기보다는 상호 보완 적으로 협력하려는 훨씬 더 많은 플랫폼 간 태도와 의지를 가지고있는 것 같습니다 (예를 들어 Mono는 다가오는 OWIN / Helios ASP.NET 환경에서 매우 중요한 부분). 앞으로 몇 년 안에 이식성의 차이가 빠르게 줄어들 것이라고 생각합니다.

2018 년 업데이트

이것에 대한 나의 견해는 다른 방향으로 가고 있습니다. .NET은 광범위하게, 특히 .NET Core에서 Java와 "이동성 패리티"를 달성하기 시작했다고 생각합니다. 일부 플랫폼의 경우 WPF를 .NET Core로 가져 오기위한 노력이 진행 중이며 .NET Core 자체는 현재 매우 많은 플랫폼에서 실행됩니다. Mono (현재 Microsoft가 소유 한 Xamarin 소유)는 그 어느 때보 다 성숙하고 세련된 제품이며 여러 플랫폼에서 작동하는 응용 프로그램을 작성하는 것은 더 이상 .NET 해커의 심층적인지 영역이 아니지만 비교적 간단합니다. . 물론 Windows 전용이거나 특정 플랫폼 만 대상으로 할 수있는 라이브러리와 서비스 및 응용 프로그램이 있습니다.하지만 Java에 대해서도 마찬가지입니다 (광범위하게).

이 시점에서 내가 OP의 입장에 있었다면,이 시점부터 앞으로 나아갈 모든 응용 프로그램에 대해 .NET을 선택하지 못하게하는 언어 나 기술 스택 자체에 내재 된 이유를 생각할 수 없습니다.


Mono는 내가 지원하고 싶은 플랫폼을 타깃팅하는 데 더 효과적입니다. 그 외에는 모두 주관적입니다.

다음 플랫폼에서 C # 코드를 공유합니다.-iOS (iPhone / iPad)-Android-웹 (HTML5)-Mac (OS X)-Linux-Windows

더 많은 곳에서 공유 할 수 있습니다 :-Windows Phone 7-Wii-XBox-PS3-등.

MonoTouch 가 환상적으로 작동하기 때문에 가장 큰 것은 iOS 입니다. Java로 iOS를 대상으로하는 좋은 방법을 모르겠습니다. Java로 Windows Phone 7을 타겟팅 할 수 없으므로 Java가 모바일에 더 적합했던 시대가 우리 뒤에 있다고 말하고 싶습니다.

나에게 가장 큰 요소는 개인의 생산성 (그리고 행복)입니다. 언어로서의 C #은 Java IMHO보다 몇 년 앞서 있으며 .NET 프레임 워크는 사용하는 즐거움입니다. Java 7 및 Java 8에 추가되는 대부분의 기능은 수년 동안 C #에있었습니다. Scala 및 Clojure (둘 다 CLR에서 사용 가능)와 같은 JVM 언어는 꽤 좋습니다.

저는 Mono를 그 자체의 플랫폼 (훌륭한 플랫폼)으로보고 .NET을 Windows에서 Mono의 Microsoft 구현으로 취급합니다. 이것은 내가 먼저 Mono에서 개발하고 테스트한다는 것을 의미합니다. 이것은 훌륭하게 작동합니다.

Java와 .NET (예 : Mono)이 기업의 지원이없는 오픈 소스 프로젝트라면 매번 Java보다 Mono를 선택합니다. 나는 그것이 더 나은 플랫폼이라고 믿습니다.

개인적으로 JVM에서 Java 이외의 다른 언어를 사용하지만 .NET / Mono와 JVM은 모두 훌륭한 선택입니다.

다른 의견에 대한 나의 견해 :

문제 : 성능.

** 답변 : JVM과 CLR 모두 비방하는 사람들이 말하는 것보다 더 나은 성능을 보입니다. JVM이 더 잘 수행한다고 말할 수 있습니다. Mono는 일반적으로 .NET보다 느립니다 (항상 그런 것은 아닙니다).

저는 개인적으로 개발자이자 최종 사용자로서 J2EE를 통해 ASP.NET MVC를 사용합니다. Google Native Client에 대한 지원 도 매우 멋집니다. 또한 데스크톱 Java 앱의 GUI 성능 저하가 과거의 일이라는 것을 알고 있지만 계속 느린 것을 찾습니다. 그런 다음 다시 WPF에 대해 동일하게 말할 수 있습니다. GTK #은 충분히 빠르기 때문에 느릴 필요가 없습니다.

문제 : Java에는 더 큰 라이브러리 에코 시스템이 있습니다.

답변 : 아마도 사실이지만 실제로는 문제가되지 않습니다.

Practically every Java library (including the JDK) runs just dandy on .NET/Mono thanks to IKVM.NET. This piece of technology is a true marvel. The integration is amazing; you can use a Java library just like it was native. I have only had to use Java libraries in one .NET app though. The .NET/Mono ecosystem generally offers more than I need.

Issue: Java has better (broader) tools support

Answer: Not on Windows. Otherwise I agree. MonoDevelop is nice though.

I want to give a shout-out to MonoDevelop; it is a jewel. MonoDevelop integrates most of the tools I want use including code completion (intellisense), Git/Subversion integration, support for unit tests, SQL integration, debugging, easy refactoring, and assembly browsing with on-the-fly decompilation. It is wonderful to use the same environment for everything from server-side web to mobile apps.

Issue: Compatibility across platforms.

Answer: Mono is a single code-base across all platforms, including Windows.

Develop for Mono first and deploy to .NET on Windows if you like. If you compare .NET from MS to Java though then Java has the edge in terms of consistency across platforms. See next answer...

Issue: Mono lags .NET.

Answer: No it does not. IMHO, this is an often stated but incorrect statement.

The Mono distribution from Xamarin ships with C#, VB.NET, F#, IronPython, IronRuby, and I think maybe Boo out of the box. The Mono C# compiler is completely up to date with MS. The Mono VB.NET compiler does lag the MS version. The other compilers are the same on both platforms (as are other .NET languages like Nemerle, Boo, and Phalanger (PHP) ).

Mono ships with a lot of the actual Microsoft written code including the Dynamic Language Runtime (DLR), Managed Extensibility Framework (MEF), F#, and ASP.NET MVC. Because Razor is not Open Source, Mono currently ships with MVC2 but MVC3 works on Mono just fine.

The core Mono platform has kept pace with .NET or many years and the compatibility is impressive. You can use the full C# 4.0 language and even some C# 5.0 features today. In fact, Mono often leads .NET in many ways.

Mono implements parts of the CLR spec that even Microsoft does not support (like 64 bit arrays). One of the most exciting new pieces of technology in the .NET world is Rosylyn. Mono has offered the C# compiler as a service for many years. Some of what Rosylyn offers is available via NRefractory as well. An example of were Mono is still ahead would be the SIMD instructions to accelerate gaming performance.

Microsoft does offer a number of products on top of .NET that are not available in Mono which is were the misconception about Mono lagging comes from. Windows Presentation Foundation (WPF), Entity Framework (EF), WCF (Windows Communication Foundation) are examples of products which do not work, or are poorly supported, on Mono. The obvious solution is to use cross-platform alternatives like GTK#, NHibernate, and ServiceStack instead.

Issue: Microsoft is evil.

Answer: True. So what.

Many people offer the following reasons to avoid using Mono:

1) You should not use Mono because Microsoft tech should be avoided

2) Mono sucks because it does not let you use every technology that Microsoft offers

To me, it is clear that these statements are incompatible. I reject the first statement but will skip that argument here. The second statement is true of all .NET alternatives.

The JVM is a great platform and the explosion of JVM languages is awesome. Use what makes you happy. For now, that is often .NET/Mono for me.


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.


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.


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.


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.


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.


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.


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.


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.


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


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.


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.


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.


Gatorhall do you have some data to back that up?

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.

Background: I'm a Windows guy since Windows 3.1 and currently a Linux user (still running Windows 7, great OS, on a VM for Visual Studio 2010 and other tools).

The point: me and a lot of users (windows, linux, etc) I know, may disagree from you. Java tends to perform slower even on a linux desktop application, ASP.NET perform's faster that java server pages many of the times. Some may agree that even non-compiled PHP performs better i several scenarios.

Java is more cross-platform? I have no doubts about this (the history back this on), but faster (not saying .NET is) not so certain and I would like to see some real benchmarks.

참고URL : https://stackoverflow.com/questions/61559/is-net-mono-or-java-the-better-choice-for-cross-platform-development

반응형