-2

TL;DR

  1. How is the new .NET approach to being a multi platform framework better than what Java did long ago?
  2. What are the key differences in the implementation?
  3. What are the advantages and disadvantages of each?

You can nowadays compile and run C# code "natively" in Linux and Mac. All of this because .NET is going multi platform. It was 2004 more or less when I started developing and by the time I heard about Java it wasn't as popular as it once was.

For what I understand Java used what was called an invisible virtual machine to run java code and, again for what I understand, .NET is being compiled directly for the target operating system. If that is correct I can see how .NET would outperform Java. Am I wrong here? Is there more to it than this?

closed as primarily opinion-based by rwong, gnat, Robert Harvey, Greg Burghardt, 8bittree Nov 30 '17 at 22:09

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Can you provide some reference that indicates C# compile natively to linux and Mac and/or that this is something that is widely done? The CLR is pretty central to .NET as I understand it. – JimmyJames Nov 30 '17 at 17:30
  • @JimmyJames: I'm guessing he means native as in MS provides a CLR for each platform rather than 3rd parties doing it. – whatsisname Nov 30 '17 at 17:46
  • C# compiles to byte code (but to be clear MSIL, which different byte code than Java). – Erik Eidt Nov 30 '17 at 18:09
  • 2
    Your question is extremely unclear: "How is the new .NET approach to being a multi platform framework better than what Java did long ago?" – What is the "new .NET approach"? // "What are the key differences in the implementation?" – Which implementation? There are about 4 different implementations of .NET and more than a dozen implementations of Java. // "What are the advantages and disadvantages of each?" – Of what? The approaches or the implementations? – Jörg W Mittag Nov 30 '17 at 20:10
5

It's not.

.Net code compiles to IL which is run on a CLR enter image description here

Its always been multi-platform in this sense and Mono has been around for a while now. http://www.mono-project.com/

I guess what you are referring to is the new .Net Standard and .Net Core projects. Essentially they are trying to slim down the key components of the .net framework in order to make cross platform CLRs easier to implement.

So you can now run .Net Core web sites running .Net Standard code on Linux boxes with a few clicks.

If there is a difference its probably that there doesn't seem to be a big push to get the WPF desktop app framework ported over yet. I think there is an acceptance that Java (apps) failed because although they would run on anything it always looked a bit pants.

Its hard to get that smooth feel on different platforms without writing specific presentation code for each. Which leaves you with two codes bases whatever you do.

  • Well, despite the downvotes I think this really answers the question. So we're assuming here that .NET is not inherently better than Java, is just that .NET focus is on web apps or console applications that would look the same regardless of the platform. Makes a lot of sense – PedroC88 Dec 1 '17 at 16:51
  • wow I hadnt noticed the downvotes, I cant imagine how this can be 'opinion-based' – Ewan Dec 1 '17 at 16:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.