DEV Community

Alicia Johnson
Alicia Johnson

Posted on

Why do I think Dot NET is Better Than Java?

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. When we talk about Java, it is a programming language while Dot Net is a framework supported by Microsoft.

.NET and Java both seek to enhance application creation through the availability of a range of defined modular components and services. Developers can focus on business requirements instead of programming basic services with standard components and services at their disposal.

Alt Text

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.

Why Dot NET is better than Java?

It is the most secure- In Dot Net, safety issues have been properly handled and the new innovations have been applied. 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.

It supports cross-platform web development- Dot NET promotes the development of cross-platform applications that allow the user to create Windows, Linux, and Mac applications. The whole backend will use the same C# code in much clearer terms.

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.

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.

Bottom Line

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.

Top comments (14)

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
 
moaxcp profile image
John Mercier

How is your first statement true? AdoptOpenJDK 8 is at 8u265. Oracle jdk 8 is at 8u261. Clearly openjdk 8 is still receiving patches. There may be certain patches that are only available to oraclejdk but the community is open source and does what it wants.

I'm not sure what performance comparison is being done here? Am I supposed to count the number of improvements in each tech for you? How would that convince me one way or the other? My purpose was only to point out that java does compile to native code at runtime. It was addressing this part of the article "and not directly for the computer."

Thread Thread
 
moaxcp profile image
John Mercier

The linked article is clearly not informed. Why is javascript (node and jquery) included on the java side of the logo? Those technologies are not related to java at all. Another example, one java disadvantage is Single Paradigm language. This is not true. Java 8 introduces lambdas and the functional programming paradigm.

Memory Management - which parts of dot net use garbage collection? Since dotnet uses garbage collection how is this a disadvantage of java and not of dotnet?

Look and feel - Java supports native look and feel for all major platforms in both swing and javafx desktop applications. No disadvantage I can see.

The rest of the article brings up issues with java 6 or 7 which are not relevant to developers today. And a fake claim that java is more for linux than windows applications.

dotnet may be better than java. I would really like to see both improve over time. The competition is good. But these articles are not convincing me to choose one over the other.

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.

Thread Thread
 
khmarbaise profile image
Karl Heinz Marbaise • Edited

Unfortunately you are not up-to-date with the development of Java cause we are talking about the OpenJDK and not about Oracle JDK any longer. Oracle does not dictates programming languages features etc. there are JCP (Java Community Process)/ JEP process etc. which allows organisations/individuals to contribute code to the OpenJDK etc.

The source code is available under GPL v2.

There is not certification of the Java programming language by Oracle (OCP is something different). There is a TCK (Technology Compatibility Kit) which checks for compatibility. (See the Link Wikipedia to OpenJDK)

en.wikipedia.org/wiki/OpenJDK
en.wikipedia.org/wiki/Java_Communi...

Furthermore I strongly recommend to take a deep look into the lecture of Mark Reinhold on FOSDEM in 2019 (also some lectures before that).
archive.fosdem.org/2019/schedule/e...

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.

If we are talking about commerical projects we can see that on AWS you can have Corretto by Amazon...several organizations etc. are using AdoptopenJDK (insurance/banks) ...

BTW: About which certification are you talking about?

Thread Thread
 
slavius profile image
Slavius

It seems you are not up to date with licensing and IPO.

Oracle is the one and only owner of Java. As a successor to Sun microsystems can and will prevent you from making modifications to Java programming language and software platform on their will.

Look up a "Google vs. Oracle America" (2015 - 2020) case where Google wanted to fork Java language and Sun simply refused to license it to Google (as Google wanted to make modifications and make Java PL open-source) just because Sun did not want modification to the Java PL. End of story. Google though they are smart enough and ended up in law suit over copyright and patent infringement of Java API.

Where in the world of open source would you be sued for forking or re-implementing a free software?

Distributions of OpenJDK are being certified that requires a commercial license from Oracle. Like the one from OpenLogic, RedHat, Zulu or Corretto .

blogs.oracle.com/java-platform-gro...

Thread Thread
 
khmarbaise profile image
Karl Heinz Marbaise

The modification of the programming language is not the point. The point is the compatibility between distributions which is fixed by the TCK which needed to be licensed by signing (openjdk.java.net/legal/OCTLA-JDK9+...) which makes sure to have the Java implementation (OpenJDK) is compatible with the other implementations. Furthermore is makes sure that an individual can not change existing code which would break compatibility which makes sense).

Furthermore the link reference to blogs.oracle.com/java-platform-gro...
does not tell something about a commercial license needed to make an OpenJDK...

That is, the OCTLA is for individuals and organizations who are working in and contributing to the OpenJDK Community, with OCTLA tested implementations from such individuals and organizations distributed only under the GPL license of the OpenJDK code.

Also this makes sure the code is distributed under GPLv2 otherwise I could create something and later say I want money (license fee) for the change(feature) I(whoever) made...

The example given is the IBM J9 which is a JDK which is implemented completely different but is conforms to TCK...and for that the commercial licensed is needed.

The part about Goold vs. Oracle was/is about changes Google want to make for Android (en.wikipedia.org/wiki/Google_v._Or...)...

So in the end there is no difference in using AdoptOpenJDK, Corretto etc. which are consuming patches for security bug fixes etc.

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.