DEV Community

Why do I think Dot NET is Better Than Java?

Alicia Johnson on August 21, 2020

There are a lot of resemblances among Dot Net and Java, but there are some significant differences that make me want to discuss where and when Dot...
Collapse
 
moaxcp profile image
John Mercier

I have some disagreement. Here are a few references for each point you are making.

Security - The jdk and jre receive regular security patches from Oracle. Patches are contributed from partners such as RedHat and Google

Cross-Platform - I'm not sure where the argument is here. Java has run on many platforms since the beginning. A well known instance is Minecraft Java Edition, which plays on linux and windows with the same jars. You can develop the same spring-boot application on any OS. I'm not sure the support for developing with .net is as easy on linux.

Performance - The jdk is able to compile bytecode to native cpu instructions. This is described here. The jdk has continued to evolve in performance with each new release.

Collapse
 
slavius profile image
Slavius

First things first. Every OpenJDK/JRE version higher that 8 does not receive patches from Oracle anymore. Oracle changed that and provides patches only to commercial (a.k.a. commercially licensed) Java versions. There is RedHat, which releases OpenJDK with recent patches but you get those patches, again, only on subscription based RedHat Enterprise Linux OS.
No free Java patches anymore from Oracle. I personally considered that as low blow from Oracle.

Regarding performance - I did not read any changelogs from OpenJDK development recently but the sheer amount of optimizations that goes into .Net Core with each release is just mind blowing. Just scroll fast through one of those "performance improvements in this release" blog posts like here and you'll understand they mean it. devblogs.microsoft.com/dotnet/perf...

Collapse
 
khmarbaise profile image
Karl Heinz Marbaise • Edited

If you don't like to use RedHat I can use:

Completely free...

Information about changes / security fixes etc. see blog.adoptopenjdk.net/

About changes etc. from Oracle /OpenJDK I strongly recommend to start reading:

oracle.com/java/technologies/javas...

More detailed for only the last 300 days:
bugs.openjdk.java.net/secure/Confi...

Thread Thread
 
slavius profile image
Slavius

Completely free updates that are not from Oracle...

Mandatory read: developers.redhat.com/blog/2018/09...

`Oracle recently announced that it would no longer supply free (as in beer) ... JDK releases ... , and neither would Oracle engineers write patches for OpenJDK bugs.

Keeping Java updated in the absence of support from Oracle engineers will be a challenge to the Java community ...`

Thread Thread
 
khmarbaise profile image
Karl Heinz Marbaise

Why do we need something from Oracle? What is so important about the relationship to Oracle?

Thread Thread
 
slavius profile image
Slavius

Oracle invented Java programming language. Oracle owns patents and the source code of Java programming language. Oracle dictates Java programming language features and defines its API and ABI. Oracle certifies Java programming language implementations.
You can have Java without Oracle but only for community / hobby projects as no one from financial, banking, government, security, aerospace, etc. sectors will want to use Java implementation that is not certified and may not work / may work differently that the one from Oracle.

Collapse
 
khmarbaise profile image
Karl Heinz Marbaise • Edited

I have to add some disagreements as well here:

There are a lot of resemblances among Dot Net and Java, but there are some significant differences that make me want to discuss where and when Dot Net is the best choice for your desktop, web, and mobile software development project.

The interesting part is that the linked article contains a lot of very similar text parts with also a lot of wrong statements as well. And also contains statements which contradicts the parts in your article?

Very strange quote of the article:

Platform-Independent – Java offers the comfort of write program once and run on any hardware and software platform and any Java-compatible browser. This gives the ability to move easily from one computer system to another.

That shows that this article also contains a lot of misunderstanding or even worse wrong knowledge about java and it's runtime environment etc. Just a single quote from that linked article.

Quote from your article:

When we talk about Java, it is a programming language while Dot Net is a framework supported by Microsoft.

You seemed to misunderstand two things. Yes Java is a programming language. It is extremely wide used with an extremely large ecosystem (ten thousands of libraries, tools etc.) which is supported by a large number of companies and communities.

Java and .NET have been built to allow programmers to build Web applications that are "steady." A 3-stage framework consists of a client level, server level, and database level. Dot NET and Java both provide transactions that allow business processes and data in databases to be triggered.

For Dot Not I can't say but for Java I can say what you have written is simply wrong, cause Java does not provide transactions. Only frameworks (for example: hibernate/JPA)/ JEE Standards (running on Application servers) are providing transactions. But technically I can implement transaction functionality in Java or in Dot Net.

For open-source projects such as Java, lack of infrastructure, and qualified assistance is hardly feasible. Consequently, Java Runtime's regular updates and other elements ruin user interactions and cause distractions to others.

  • First in general you seemed to misunderstanding the concept of open-source projects. Java itself is not an open source project. It is supported by large number of contributors etc. and run by Oracle employees which are the leaders of the project (some changes over the time have been done).
  • I don't understand what your statement about "qualified assistance..and Java Runtime's regular updates (yes sometimes based on CVE fixes; regularly done oracle.com/security-alerts/
  • Or are you talking about support for Java, JDK, Tools?

It provides better performance- The huge achievement that Dot NET has acquired is its brilliant performance. All the new updates and improvements lead to an optimized code that in return boosts the performance. The most important thing is that you don't have to change the code in reality.

Where is any comparison for that statement? The performance of the JVM is increasing steadily. There no need to change the code either.

I strongly recommend to read about GraalVM which compiles your Java application into native code and the performance is another step better than via usual JVM...

It has a mature runtime as CLR- In many technical details, the Common Language Runtime (CLR) is superior to JRE or JVM. It is because JVM is a compiler and simply translates Java Byte code into an extensive instruction for, and not directly for the computer. This is also still sluggish and needs daily updates to accommodate further operating systems. In comparison, the CLR of Dot Net is not the case.

Mixing concepts and misunderstanding what JVM really is. JVM is the Java Virtual Machine which is a concept to define a machine with Virtual processor which is emulated (very very simplified) on the hardware machine. More details here:

The JVM (en.wikipedia.org/wiki/HotSpot) uses a HotSpot part which optimises (compiles into machine code during runtime..simplified) the code parts which are used very heavily (HotSpots) very very simplified.

So first JVM is the Java virtual machine and is not the compiler. The byte code which is used for compiled Java code it is extremely stable that you can run byte code which has been compiled with Java 1.1 with a todays JVM (for example JVM 8).. This is most important things which the designers of the language and the JVM etc. have done is backward compatibility. You can run very old code on newest JVM versions.

If you trust in Microsoft's strengths and its ASP.NET framework, it's time to join in, rather than wander around dangerous open-source environment, where you have to go extra miles to achieve something significant. Of course, a team of seasoned Dot Net developers is needed to make the most out of it and give remarkable results.

This part sounds like a statement of Steve Ballmer about Linux is like cancer.

Collapse
 
alainvanhout profile image
Alain Van Hout

I would honestly think that this post is just trying to sell something, except there doesn't seem to be a commercial link anywhere. Beyond that, I don't understand how you could pack so many explicit falsehoods into a single post. Are you trying to run for political office or something?

Collapse
 
chabala profile image
Greg Chabala

This post is bizarrely incoherent and should not be taken seriously by anyone.