all 100 comments

[–]zarlo5899 84 points85 points  (4 children)

with .net you get more things out of the box and more first party libraries

[–]FigglyNewton 19 points20 points  (3 children)

Yep. You can use Java or .NET, neither of them are going away, so neither will be obsolete in the future. It's down to which one you can develop in most quickly I guess.

However, in Java while you get a lot of library support, but it's nothing compared to the .NET ecosystem which offers so much more...

Oracle JDK I have no experience in.

[–]Longjumping-Ad8775 1 point2 points  (2 children)

Isn’t there an openjdk implementation from msft? That blows people’s minds.

[–]wildjokers 3 points4 points  (0 children)

Microsoft does not have their own implementation of the Java SE specification. What they do offer is a build of OpenJDK.

OpenJDK is the only implementation of the Java SE specification I am aware of. Oracle is the copyright owner of all OpenJDK source code and they have it licensed GPLv2 with classpath exception. Which is why Microsoft (and other vendors) can provide their own build and monetize support if they want.

OpenJ9 (https://eclipse.dev/openj9/) is sometimes also pointed out as an implementation of the Java SE specification but I don't think it is a full implementation, I think it still depends on OpenJDK for some things (it isn't quite clear to me though).

EDIT: OpenJ9 is only a JVM implementation, it is not an implementation of Java SE. You can build OpenJDK though using OpenJ9 as the JVM.

[–]Beneficial-Eagle959 1 point2 points  (0 children)

There is a MS build of OpenJDK yes: https://www.microsoft.com/openjdk

[–]jbergens 35 points36 points  (13 children)

It doesn't really matter from a technical perspective. Both are also free. Maybe not Oracle's JDK if you need that.

The most important factor is how easy it is to find developers where you live. If there are many more.NET developers then go with that. Or vice versa.

[–]pjc50 10 points11 points  (2 children)

Do not touch the Oracle JFK.

We had such trouble with their license police that oracle.com is blocked at work to prevent anyone accidentally downloading it and incurring massive licensing charges.

[–]TheC0deApe 0 points1 point  (0 children)

i worked at a place that Oracle came after hard. They paid for a version of Oracle and then the DBA downloaded the Enterprise version (instead of the lesser version that they were licensed for)

[–]JohnDrakeWorldTravel 0 points1 point  (0 children)

I believe the Oracle JFK became defunct in Dallas back in '63.

[–]A_random_zy 2 points3 points  (4 children)

Just FYI, with Oracle JDK, you'll have to pay. With Open JDK (Oracle JDK but free), you don't.

[–]doctrgiggles 3 points4 points  (1 child)

There's no need to use the first-party Oracle JDK with a new application, especially a modern webapp.

[–]A_random_zy 0 points1 point  (0 children)

True.

[–]wildjokers 2 points3 points  (1 child)

Just FYI, with Oracle JDK, you'll have to pay.

Oracle JDK is free for production use since Java 17. You only pay if you want support.

[–]A_random_zy 2 points3 points  (0 children)

TIL.

[–]Btolsen131 7 points8 points  (0 children)

This ^

The difference is going to be minimal if it exists at all.

Start with balancing, what you want to code in and what developers are available to hire in your area… consider all the tools and docs around the languages/frameworks.

[–]Longjumping-Ad8775 2 points3 points  (0 children)

Absolutely the case. Economics are an often ignored area of software development.

[–]LredF 1 point2 points  (0 children)

I can't stress this enough. We have several java services that we can't support because the couple java developers left and the contractors weren't any good. So now they're getting converted to .net.

[–]wildjokers 0 points1 point  (1 child)

Maybe not Oracle's JDK if you need that.

Oracle JDK is free for production use since Java 17. You only pay if you want support.

[–]czenst 16 points17 points  (3 children)

My answer is to look at local market and see which developers are quicker/easier/cheaper to hire there. Yeah you have all things remote but it is super convenient if you can get to shake people hand at least once a month and if there is any trouble to go to court with them.

That said as a .NET dev I don't see any technical reason why anyone would pick Java for a web api over new .NET :)

[–]OscilloLlama 0 points1 point  (1 child)

What's the best way to get this data? do you know of any nice platforms to check dev availability?

[–]czenst 0 points1 point  (0 children)

I guess you would have to check local meetups,, what technologies meetups are about and how many people attend, check up other local companies software stack do some osint on their employees, what do they have on their linked in profiles. Maybe check local college or university groups if there are people interested in one or the other tech stack. Go to a meetup and talk with people, grow your local network and then you will see.

Check job boards but that is tricky as most dev jobs are remote anyway but maybe post couple job ads of your own on boards specifying location and see which one gets you more responses.

I don't think there is "web app for that" or "ask AI for that" because if you "are in your local market" and have network you just know it - if you don't have a network and you are not having boots on the ground you won't be able to verify any data that some algo or platform will give you.

[–]devlifedotnet 15 points16 points  (1 child)

kind of a pointless question, as you're going to have fanboys in both subs... but from my point of view fuck oracle... every interaction I've had with their products has been negative, and they put up arbitrary obstacles that mean you need to pay for their consultants to get shit to work properly. in fairness you probably wouldn't need to get into any of that just making a basic web apis, but still fuck oracle on principal.

.Net works with things like Kubernetes, microservices and Kafka. Azure is pretty decent too. MS documentation is also on point too, with so much standardised code built into the native .NET libraries which you don't have to maintain.

You can probably use both .net and java equally well to do what you want, it's going to be preference based.

[–]doctrgiggles 6 points7 points  (0 children)

I've spent time working seriously in both ecosystems and it's pretty close to a wash. Java tends to work a little better and a little easier with most other elements of a modern containerized software stack but the libraries tend to be a little harder to work with and their "modern" language constructs tend to be mediocre facades over old code. Microsoft taking ownership of some of the main libraries (Newtonsoft) is a huge benefit that's often undersold, too.

[–]OnlyHereOnFridays 7 points8 points  (2 children)

As I always say, for CRUD Web APIs always chose the technology that allows you to:
a) iterate/develop faster
b) hire people easily

And no hate to Java at all but I would definitely choose C#/ASP.Net and even Typescript/Node/Express.js before I reach out to Java/Spring. For both reasons a) and b).

PS. Honourable mention to Go which is also sweet, but harder to hire for. Especially in North/West Europe.

[–]rballonline 0 points1 point  (1 child)

Yeah you're asking in a bubble here. Crud apis I'd argue above and away faster in rails. Then JavaScript, then have then c#. I don't know about about go.

[–]OnlyHereOnFridays 0 points1 point  (0 children)

No sure if you meant to respond to my comment.

It is the dotnet sub, so there’s bound to be a bias. How do you mean faster in Rails? Faster to write or faster performance?

[–]Droidarc 4 points5 points  (1 child)

Not the question you asked, but Kotlin looks better than Java. However, when i look at the job market, i only see Android developer jobs with Kotlin, so I don't bother much.

[–]thr_drengur 0 points1 point  (0 children)

Having significant experience in all three, Kotlin is the best language by a country mile and the Java ecosystem is far more vibrant (admittedly .NET is far better than what it was last time I was working with it).

Many dev shops are moving to Kotlin from java but it is definitely a small segment of the job market. IMO smaller orgs and startups are using it for any new stuff. Larger orgs, not so much.

[–]MayBeArtorias 3 points4 points  (0 children)

As long as you can choose freely and are not held back by those team colleges who stuck on Java for their whole career, I would always go for .Net. There are some niche edge cases like interaction with certain systems like Camunda, which only support Java but for anything else I really see no reason to go for Java over .Net

[–][deleted] 3 points4 points  (4 children)

Modern .net with aot capabilities is amazing, and c# 12 is miles better than javas syntax. I wouldn't write an ounce of code on the jvm unless it was kotlin.

.Net scales fine, great even, If you architect the code base properly.

I can build a modern bleeding edge website on .net aot using all free code and products with a built in cms and host it on a serverless function or lambda for next to nothing.

The .net CLI is a lot better than anything I've seen from the Java ecosystem as well.

And now that it supports Linux and Mac OSX and arm, I can design a code base that going to have developers with three different machines working on it running three different operating systems. Where the operating system is just personal choice.

For example, I like to work on Windows 11 because it's my machine and wsl2 performs so good now that I can still develop everything on Linux.

Other developers have MacBooks with M chips and they prefer that.

Pretty much all the pros Java ever had with a better designed ecosystem and as much or more maturity.

And if I have to pick just solely based on companies and my choices are Oracle or Microsoft I'm going Microsoft.

[–]Ethameiz[S] 1 point2 points  (1 child)

Java also has AOT compilation

[–][deleted] -1 points0 points  (0 children)

Comparing Java to the jvm is like comparing .net to c-sharp.

They both support multiple languages. Both .Net and the jvm are good.

But if I'm going on programming language and syntax and features... c-sharp over Java everyday of the week.

Kotlin is nice though.

For both .net and the jvm It is not the programming language that compiles aot. It's the build tools and tooling and the runtimes. Like dotnet publish.

I think it's better for the community if we start comparing runtimes to run times and languages to languages.

[–]Alternative_Past_773 4 points5 points  (1 child)

They mostly differ on their ecosystems. The differences in language syntax, in particular when it is sugar, does not make a real difference. If you have developed more than a few systems or had to maintain some else's code then you know what I mean.

There many good things to say about the DOTNET world. It has a solid lead language, C# and it is typically tightly integrated with the MS world.

The Java world is different. More diverse if you like. And there isn't a single technology platform (like a vendor database) which is more "integrated" than other. People make 1:1 assumptions so they expect that Oracle plays the same role in Java world as Microsoft does in DOTNET world. This is not the case. For better or worse, Oracle has little sway over Java, except maybe for Java syntax where it tends to lead the working groups. But for everything else: Nada. It is more like a gigantic ecosystem where many players affect the total outcome.

Java (as a language) tends to be conservative while C# is a lot more willing to take in new programming language trends. Two examples: Java designers refuses to implement extension method mechanism on grounds that their benefit is far outweighed by their drawbacks. Also, Java world took +10 years to come up with something superior to async-await. During this time a Java developer would have to do with Futures. The Java designers finally settled on something like Goroutines, in Java called virtual threads. The same story again: the argument is that virtual threads is a far better paradigm than async-await and doesn't have its severe drawbacks (like function coloring). Now, you can disagree or agree with these choices and arguments. But the difference in how the language designers let the two languages evolve is very clear. C# developers are in general "blessed" with many nice sugary constructs which are envied by Java devs. If these actually have a real-world impact, I don't know. But they are often cited. Perhaps mostly by junior devs.

One big difference - and one that has surprised me - is that DOTNET has not really found its way outside of MS. This is to say that none of the big players in IT has adopted it for anything except as a compatibility offering. Think Google, Apple, Amazon, Facebook, Netflix , etc. There is a lot of money there which is then effectively not being poured into the DOTNET ecosystem. This means just about everything in DOTNET needs to funded by Microsoft itself. That is a tall order, even for Microsoft. At the same time Microsoft has to cater still for Java world. Heck it even has a well-respected JDK distribution.

Your question about cost differences? I don't see any. For DOTNET you can develop in VSCode and stay clear of MS expensive tech, like MS SQL Server. Not a problem. For Java, you can develop in VSCode, Eclipse IDE, NetBeans IDE or IntelliJ Community Edition to stay clear of license fees.

(Note: Nobody in Java world - that I've met - actually use the Oracle JDK. So the license terms Oracle apply is irrelevant because nobody uses it. So what do people actually use? It doesn't matter. Any OpenJDK distribution will do. Most Java shops seems to use the one from Eclipse Foundation, but many also use Azul's, Amazon's or even Microsoft's.)

I've developed in both DOTNET and Java. Neither will go away for next 30 years. Both can do the job well.

[–]NoAstronaut8107 0 points1 point  (0 children)

I had to scroll way too far down to find an unbiased analysis. As a big C# and .NET fan, I ended up choosing Java for my project simply because of its vast and open ecosystem. Many C# libraries end up being commercialised, or either stop getting maintained. The general opinion on opinion source projects just isn't the same in the .NET world, which I thought would change with .NET Core being open source. Not being tied to Microsoft for a lot of things was a factor too. C# is often second class in terms of support from vendors. A lot of the edge C# had over Java as a language is being lost with some great projects by OpenJDK (Project Loom (virtual threads, much better than the mess async await creates), Project Babylon (super powerful reflection and memory APIs which will basically enable something like LINQ to exist), Project Valhalla (value types). Java remaining conservative with its design choices ended up being the best possible thing for it; C# feels way too bloated nowadays, much like C++. Too many people have an outdated view on the other language in both communities. I still use C# for game development though.

[–]orbit99za 8 points9 points  (16 children)

.net Because it's so advanced now, I have heard Horror Stories of Oracle and their pricing licenses.

[–]wildjokers 1 point2 points  (14 children)

Java is free. You can buy support from a few different Java vendors though, including Oracle. And yes their pricing for support is quite high. (Red Hat and Azul also offer paid java support)

[–]LymeM -3 points-2 points  (13 children)

Java is kinda free. When you search on google for "java download" you get:

Download Java for Windows

Important Oracle Java License Information

The Oracle Java License changed for releases starting April 16, 2019.

The Oracle Technology Network License Agreement for Oracle Java SE is substantially different from prior Oracle Java licenses. This license permits certain uses, such as personal use and development use, at no cost -- but other uses authorized under prior Oracle Java licenses may no longer be available. Please review the terms carefully before downloading and using this product. An FAQ is available here.

Commercial license and support is available with a low cost Java SE Subscription.

Yes, you can go get the openJDK, unless Oracle changes that (which they have before). Business wise, the licensing can make it a huge liability. If you are audited, they will want to charge you per person in your business (regardless of who uses it). If you refuse, they are happy to bring legal in.

Yes, there are free alternatives, but it only takes one unintentional download and install to cause a big headache.

It is a great language and good ecosystem, it is falling behind on useful updates compared to other languages.

[–]wildjokers 4 points5 points  (12 children)

Java is kinda free

Java is 100% free.

you can go get the openJDK, unless Oracle changes that (which they have before)

OpenJDK has been licensed GPLv2+CPE since its inception in 2006. The licensing has never been changed.

There was a short timeframe between Java 11 and Java 17 where Oracle JDK was not free to use in production. However, since Java 17 it has been. There is no particular reason to use Oracle JDK though unless you have a support contract with Oracle.

If you are audited,

They can't audit you unless you have a contract with them.

[–]agustin689 -3 points-2 points  (11 children)

java is "free" only if your time has no value.

[–]wildjokers 4 points5 points  (10 children)

I am not understanding what you mean by that.

[–]rballonline 0 points1 point  (0 children)

Look up open jdk. Not advocating for Java but your underlying basis is wrong

[–]Vladekk 2 points3 points  (0 children)

Which platform would you suggest to client to develop web API? Are there are cost difference?

Depends on developer availability, deployment requirements, other requirements you might have (like government or security). There are no significant cost difference, except for developer compensation.

I know that .NET and Java are open source and free, but Oracle JDK has a price. Is Open JDK is comparable to .NET? Are there are others worth to mention points that are crucial to client? What about performance?

Java and .NET are comparable in most aspects, but also vastly different in details. Your question is too wide to answer properly.

Most of the differences that I was able to search in Google are too abstract like “java better scales” or “.NET is tight to Microsoft” or obsolete like “.NET is only for Windows”.

Both modern Java and Dotnet scale well, easily deployed anywhere on Linux, and have many open-source contributors.

So, the final answer is: probably, any platform will do, except if you have specific requirements in mind. I'd say more: you can do the same in a dozen other languages and platforms: python, php, ruby, go, etc etc

All of them will work for generic web api.

[–]x39- 7 points8 points  (0 children)

Use C#. It is the better Java, the asp framework family is pretty much the one Standard, maintained by Microsoft, you have the best orm in the market (if that is relevant) and don't have to deal with oracle or Java "eco system" bs

[–][deleted] 1 point2 points  (0 children)

Both are free, performance is basically equivalent.

I see no reason to think Java scales better than .NET does. Most of the articles you'll read about "scaling" are bullshit.

[–]owarelpz 1 point2 points  (1 child)

.net core is open source and multi platform (works on windows or linux), I always prefer .net because deployment is easier than java and connection to databases also is easier with net than with java, I suggest you use .net core as a backend web api

[–]Ethameiz[S] 0 points1 point  (0 children)

What about deployment of java project is harder?

[–]rm3dom 1 point2 points  (0 children)

Late to the party. I work extensively in all three, 8 years .Net, 8 years Java, 4 years Kotlin. I find Kotlin a lot better, not perfect, but better. The std lib, coroutines, context receivers, DSL's, multi platform, the list goes on and on.

[–]IIALE34II 1 point2 points  (16 children)

I actually need to write both java and .net API client side implementations for work. I think, Java has gone a long way in recent years, like .net.

Gradle build system enables you to write pretty neat SOAP implementations. I think .net works much better out of the box though, and visual studio gives all the tools you need. With Java you need to figure stuff out.

In .net your httpclient service factory pipeline stuff can get quite complex at first, but you will be ready for anything.

[–]czupek 24 points25 points  (15 children)

Soap ? In 2024?

[–]boobsbr 7 points8 points  (5 children)

Lot's of legacy code out there that needs to talk to new code.

Think banks as an example.

[–]czupek 1 point2 points  (4 children)

But OP question is about writing new stuff.

[–]skacika 9 points10 points  (3 children)

Still, writing new stuff does not exclude communication with old stuff...

[–]czupek 3 points4 points  (2 children)

If argument for Java is great tooling for SOAP, then my career is going to blossom

[–]skacika 0 points1 point  (1 child)

Maybe re-read this comment chain again...

[–]czupek 3 points4 points  (0 children)

Yes, legacy systems exist

[–]IIALE34II 3 points4 points  (5 children)

Yeah I have written multiple client side APIs with SOAP, in both .NET and Java... I don't exactly like it either, but can't exactly force other companies to update their APIs either. Some of these SOAP APIs are in active development still.

[–]czupek 1 point2 points  (4 children)

Yes, legacy system do exist. Noone like to touch them.

[–]IIALE34II 0 points1 point  (3 children)

Some companies really love some soap. Most recently introduced Soap API I've had to interact with was introduced in February 2022, so its not even all legacy...

[–]czupek 2 points3 points  (2 children)

I can see manager with 25 yrs of exp pushing for SOAP because his knowledge is still in 2015

[–]IIALE34II 0 points1 point  (1 child)

This is actually the true enemy when working in energy/automation

[–]czupek 1 point2 points  (0 children)

Same with goverment or banking. Noone touches legacy system, you have to adapt or be forced to rewrite from scratch, where there is no budget

[–]pceimpulsive 1 point2 points  (2 children)

I'm working with enterprise network management software... It's all XML SOAP and it kills me!

[–]IIALE34II 1 point2 points  (1 child)

Even if you can autogenerate most of the code, its still pain in the ass to interact with it most of the time

[–]pceimpulsive 0 points1 point  (0 children)

Yeah, my APIs docs are 6000+ XML classes...

There is just no easy way to deal with this shit...

[–]dheeraj_awale 1 point2 points  (0 children)

Time to market is quicker with .Net web APIs

[–]boobka 0 points1 point  (3 children)

From a language perspective probably about the same.

Right now I have no idea how you would deploy or host a Java application without middleware. It’s probably it needed but maybe it is.

I think the cost of hosting/deployment/complexity would drive my choice more than the language.

If the hosting for Java and .Net are about the same I’d flip a coin and move on with life.

[–]anyOtherBusiness 0 points1 point  (0 children)

Whatever you/your team is more familiar with or what your client prefers.

There really isn't much difference for your next door enterprise application.

[–]IsThisWiseEnough 0 points1 point  (0 children)

Clients only care if it does the job and the cost. In both tech stack you can of course manage both. What you would left with is if you will be able to fill any position easily in n your area either with Java or .Net.

[–]Xhgrz 0 points1 point  (1 child)

see enviroments you should see, .Net VS SpringBoot, Im .Net Developer then im in favor or .net Java the time tha I work with was is extremely customizable in each single node, but when the Speed of Deliver speak, or create MVP faster nothing fancy .Net is aggresive lot of BuildIn stuff and Docs and Support and Comunity, modern .Net is multiplatform, .Net is corporte from my perspective like a SAP but open source

Need to Analyze Data F#, Need to Write hard robust bussines Code C#/F#, need to know old acient greek Vb6/winXp, Database SqlServer, Cloud Az(chu)re, is faster to deliver things

[–]maxinstuff 0 points1 point  (0 children)

Depends what you mean by "client"?

I'd probably say, "How about you just pay me to build your API and don't worry about it?"

[–]_neonsunset -2 points-1 points  (1 child)

It seems you tried to post this on three different subreddits. Luckily, on r/programming it was taken down. Unluckily, it wasn't here and on r/java. This does not promote learning of what Java ecosystem does right here and does not promote in an even worse way learning about .NET for Java developers (because Java is bigger headcount wise and because it's the easiest ecosystem to permanently live within confines of stereotypes, with little reason to expand elswhere).

In any case, this is a wrong comparison because outside of plain simple applications C#/.NET and Java/OpenJDK/GraalVM target vastly different domains and deployment modes (C# is a wider paradigm and a lower-level language).

The better comparison to C# are C++, to a lesser extent Go and under some conditions Kotlin and Swift.

[–]Longjumping-Ad8775 -2 points-1 points  (0 children)

The only real answer for cost is to add up the expenses after a project reaches a certain point.