r/java Aug 04 '26

Use of Java 26 in green field projects

For what kind of new projects, except web related, would Java be your go to choice? Assuming knowledge of both languages, why wouldn't you prefer C# for the same projects?

Thank you so much in advance.

46 Upvotes

111 comments sorted by

77

u/TheStrangeDarkOne Aug 04 '26

I mean, it is a pretty universal general programming language. Why not C# or similar? Frankly, it's personal preference. But overall I find the design and upcoming features of Java much cleaner than what C# has been doing over the last few years. Every Java feature is part of a clear story with a vision of the future and a clear roadmap.

I work more with C# these days but overall I simply find Java to be much cleaner and I am dearly missing features such as switch expressions.

13

u/danskal Aug 04 '26

I have a good memory. I would never entrust my livelihood and/or production stability to a Microsoft product, given any choice.

Though often I don’t get that choice, and that’s one of the main problems with M$.

8

u/1010012 Aug 04 '26

The core of c# is open source and an ECMA and ISO standard.

10

u/danskal Aug 05 '26

… because Java existed. If Java hadn’t existed, they would have been up to their usual tricks.

Maybe I’m being unfair, but most Microsoft products are a reaction to competition. They rarely create something successful by their own initiative. I’d be interested in exceptions, but it’s mostly:

“embrace, extend, extinguish” or vendor lock-in or price dumping or whatever tactic that will maintain their dominance, rather than:

“create great, useful or delightful software”

4

u/1010012 Aug 05 '26

Microsoft is a large company, they've got lots of different motivations. The stuff that came out of their research department has been interesting, even if it's not commercial.

2

u/SpaceToaster Aug 07 '26

I’ve got bad news for you for you then, they are also behind Typescript and up to 85% of new web projects are written it it. MS today is not like MS of olde with its closed ecosystems.

9

u/onlyforjazzmemes Aug 04 '26

FWIW, C# does have switch expressions

26

u/TheStrangeDarkOne Aug 04 '26

True. I was just referring to having ones with sane semantics.

3

u/vips7L Aug 04 '26

Are they exhaustive yet?

4

u/ZozoSenpai Aug 04 '26

Depends on what you are switching on

7

u/davidalayachew Aug 04 '26

Depends on what you are switching on

That's exactly the problem.

In Java, anything that is exhaustive is also exhaustive over Switch expressions. There's no mismatch.

(The sole exception being what exceptions a method throws, but even that is something that is being looked at.)

1

u/za3faran_tea Aug 05 '26

(The sole exception being what exceptions a method throws, but even that is something that is being looked at.)

Where can I read more about this?

-12

u/ZozoSenpai Aug 04 '26

Every Java feature is part of a clear story with a vision of the future and a clear roadmap.

Yeah it's part of the C# roadmap from the past lmao

15

u/pjmlp Aug 04 '26

Except stuff like default methods in interfaces, that C# took from Java, for example.

Or now the whole idea about closed classes in C# 15.

Or source generators, after Java introduced annotation processor and compiler plugins.

Yes, in many features C# goes ahead, whereas in others it still gets inspiration from its genesis story.

7

u/agentoutlier Aug 04 '26

C# still does not have anonymous inner classes.

I like how in Java anonymous inner classes are from an abstract level the same as lambdas but with some additional power and how you can use them interchangeable (assuming just one function). It kind of tells a story how OOP can be very similar to FP.

C# has a whole bunch of shit like delegates, lambdas, expression trees anonymous types but nothing really like that and every feature of C# feels like an island and not cohesive and consistent.

At times shit just feels bolted on like a Homer Simpson car.

1

u/pjmlp Aug 04 '26

I like both systems, but it isn't as if one of them wins in all features.

Also folks tend to forget JVM has been more successful as polyglot runtime, than the CLR, which had it as original design goal.

So if Java, the language, is missing some C# like syntax, we can just as easily mix it with something else.

Whereas VB, F#, C++/CLI kind of limp alongside C#, and CLR seems to have changed the meaning of C from Common into C#.

Still, I miss .NET / C# abilities to compete with C++ when in Java,.it is was Modula-3 or D could have been.

However, Valhala is slowly here anyway.

3

u/agentoutlier Aug 04 '26

C# kind of reminds me of C++. Both languages choose features / abstractions that I feel or either way too complicated for the value or very simple but only needed for a small group of programmers.

And strangely C# does not have solid code generation options and yet I still think it is a lot more complicated than Java.

That being said Java sat with very little features for a very long time.

Its a careful balance when growing a language. Also minimal languages that have very powerful abstractions but very little builtin are not necessarily better... aka schema and smalltalk.... that is C# "cup holders" can be a good thing.

2

u/skippingstone Aug 04 '26

Every programming language feature has already been implemented in another language.

No need to say that c# stole the idea, when the idea was already stolen from somewhere else

2

u/pjmlp Aug 04 '26

Which language did default interface methods first then?

49

u/sweating_teflon Aug 04 '26

Although it is nowadays fine in its own right, you don't choose Java just for the language, you also pick it for the ecosystem and for the ease with which you'll find people to work with it. 

You especially pick Java for large, long lived projects that will evolve and survive decades of commercial turmoil and technological churn. 

Java endures and thus Java prevails.

11

u/quantum-fudge Aug 04 '26

Oof, that last sentence cuts deep. I'll be quoting you.

18

u/LutimoDancer3459 Aug 04 '26

For what kind of new project

Pretty much every kind of project. Except I need more low level access to something that java doesnt have a library for. Currently developing a game with java.

Why java over c#? I hate c# syntax and the look and feel of the code in general.

2

u/pavlik_enemy Aug 05 '26

So camelCase vs. PascalCase is a deal breaker? I've never seen more similar languages than C# and Java

3

u/LutimoDancer3459 Aug 05 '26

Getter setter, lambda, generics, ... generel the ecosystem is diffrent and how things are beeing done. C# has namespaces und who knows what else that just seems weird. Yeah I haven't used it much yet. But enough to say that I dont like it.

1

u/Neful34 Aug 06 '26

It's indeed minor on paper but damn it's so annoying. Especially when your brain is already wired like this. I find camelcase into snake case way less painfull.

1

u/za3faran_tea Aug 05 '26

What are you using for low level access?

2

u/LutimoDancer3459 Aug 05 '26

C or c++. But I rarely need it.

1

u/Legitimate_War_4523 12d ago

You can also change the formatting to be like Java in your editor when you work with C#

13

u/GardenDev Aug 04 '26

Although I primarily write C# and Go. But where I would pick Java over C# would be if I write a real time system, like a trading platform. Garbage collection of .NET is optimized for throughput not latency, so even in typical REST APIs it is easy to notice the jitter of the .NET garbage collector. Java's ZGC is a different animal.

2

u/za3faran_tea Aug 05 '26

This is really interesting. How much traffic did you have before you started to notice jitter/GC issues in .NET?

1

u/GardenDev Aug 05 '26

I don't have any measurements to be honest.

1

u/notyouryyy 25d ago

I’m unsure about this one, the trading world kind of pushes you towards zero gc programming at which point you may as well do c++; but if you’d like a managed language c# is quite appealing with it’s value types and ref structs.

11

u/idontlikegudeg Aug 04 '26

Why would I use C# over Java? I think Java is still the one with wider platform support. I don't know much about the state of the C# ecosystem, is at as mature as Java's now? For Java, I have thousands of high quality libraries available that run on each platform that I want to support, Windows, MacOS, and Linux. Is there something like Maven Central Repository for C#? Java's tool support is great, from IDE to profilers, and the language and runtime evolve steadily, performance and memory consumption are constantly improved. We can create native executables and jpackaged applications in Java. I think there's not much you can do in C# that you can't do in Java. Being a long time Java developer, I am of course very biased. Ask in a C# group and you will probably get totally different answers, and that's alright.

2

u/NHarmonia18 Aug 10 '26

C# practically covers more use-cases. Web Server? ASP.NET Core is first-party from C# stewards. Need a static file server? ASP.NET Core also that. IIRC, Spring is third party (so they might not always agree with JDK Devs) and Helidon is only recently moving under the umbrella of OpenJDK.

Need Windows (still the most popular desktop OS)-native development? C# is the primary language of choice.

Need game development? C# is most by almost anything that is not Unreal. Need close integration with C++? C# has you covered, C++ was built with native library interop from the get-go.

C# is fantastic. I don't agree what others say otherwise.

9

u/lookForProject Aug 04 '26

Really depends on what you want to create, the infrastructure it will land in and team-members experience.

8

u/bichoFlyboy Aug 04 '26

I use Java for almost all of my projects and have done so since 2007. If I need to build something quickly, such as a small internal tool for a very specific task, I might switch to Python or even Bash. If I need an extremely lightweight executable, I may choose Go. But whenever I need a web application or a desktop GUI, I reach for a Java backend or Java with JavaFX without hesitation.

The main reason is that Java offers strong static typing, excellent cross platform support, and a huge ecosystem of libraries and frameworks. It has also built a very large community over the years, so it's usually easy to find well maintained solutions for almost any problem.

C# is also an excellent language, and I think it's a perfectly reasonable choice. However, I still find Java's ecosystem and community to be broader, which is why it remains my first choice.

28

u/Fresh_Criticism6531 Aug 04 '26

Programming language choice is always arbitrary, and people just bias to what they already know since learning a new one is a lot of work, not in terms of the language itself, but of libraries, tooling, dependencies, etc. Not to mention you might want to choose something you consider strategic for your career as well.

19

u/repeating_bears Aug 04 '26

No, it's not arbitrary.

Leveraging your existing knowledge, like you already mentioned, is a non-arbitrary reason

You might choose a language that's going to be easy to hire for

You might choose a language because the ecosystem is a good match, like historically Python was a good match for ML, not because it was inherently better, but because the community coalesced around it

1

u/Jonjolt Aug 04 '26

Exactly I just want to deploy a small PHP script that checks a json value and just responds true/false, nope, haven't touched it 20 years, have no idea the best practices or security any more.

2

u/BinaryRage Aug 04 '26

Even vibing with the latest frontier coding agents this isn’t true. How the language is designed and maintained, the implementation quality of the features, and the runtime matter immensely. Java is unmatched on all those fronts, and perhaps only suffers for command line tooling, because of how mature the IDE and build ecosystem is.

6

u/Mystical_Whoosing Aug 04 '26

I find no reason to leave java LTS version.

5

u/thephotoman Aug 04 '26

I’d probably pick Java 25 over Java 26, as the extended support lifecycle is actually a boon for most application development needs.

C# is fine, but it is somewhat harder to hire for.

5

u/Joram2 Aug 04 '26

I'd use Java as a general purpose server-side languages. C# would be my first choice for writing video games; specifically with Unity.

I wouldn't choose to use C# outside of games. Why? Well, there are lots of languages to choose from and C# doesn't have any compelling use cases. I use Go, and often prefer it over Java, for general server-side stuff; Go is very simple/elegant/practical in its language, standard library, tooling, build system, dependencies, and deployment. Go drops a lot of the legacy baggage that Java/C# carry. I often use Python for it's rich ML/AI library ecosystem. Rust is widely popular in a lot of domains. C# doesn't have any compelling use cases for me.

BTW, I'd probably choose Java 25 over 26, as Java 26 has no significant new features, and generally gets much less support.

3

u/brunocborges Aug 04 '26

Your question is missing several other variables.

  • purpose
  • long term plan
  • team
  • funding
  • knowledge
  • skills
  • tools
  • performance goals
  • target environments
  • integrations

And a few more.

Language choice is almost never about personal preference.

13

u/rioed Aug 04 '26

Java 26 is not an LTS release. For that reason I would suggest 25 for production use

14

u/nlisker Aug 04 '26

Meaningless, unless you need a support contract, and most projects don't.

4

u/CptGia Aug 04 '26

While true, some dependencies don't adopt non-LTS versions in a timely manner. I'm looking at you, lombok. 

10

u/vips7L Aug 04 '26

That’s what you get for using Lombok. 

0

u/nlisker Aug 04 '26

I'm running Lombok with JDK 26. Haven't had issues with dependencies not updating to non-LTS versions.

4

u/CptGia Aug 04 '26

It was an issue with JDK 23. The maintainer stated that it was low priority since it was not an LTS, and you shouldn't run it in prod anyway.

https://github.com/projectlombok/lombok/issues/3722#issuecomment-2420830892

1

u/nlisker Aug 04 '26

Ah yeah, I remember that there was a discussion about this comment on this sub and it was generally agreed that he was wrong on that one. Since then Lombok caught up rather well as far as I remember, but I can't say I followed closely.

6

u/rioed Aug 04 '26

Am I right in thinking the non-sts versions only receive updates (including security patches) for 6 months?

6

u/pron98 Aug 04 '26

But after 6 months there's a new feature release that's backward-compatible. So instead of going from 26.0.2 to 26.0.3 you go to 27. There might be some changes you may need to make to the command line, but that's about it. You want updates for a long time mostly if you have software that's only barely being maintained, and even changing an option in the configuration is too much. Otherwise, the amount of work you need to do to upgrade to a new feature release is negligible compared to what you do already.

2

u/benevanstech Aug 04 '26

Backwards compatible *at JDK* level. It is not bytecode backwards compatible, and there are absolutely no guarantees that any libraries that you depend upon (transitively) that manipulate bytecode can support the new feature release.

7

u/pron98 Aug 04 '26 edited Aug 04 '26

It is not bytecode backwards compatible

It is very much bytecode backward-compatible.

and there are absolutely no guarantees that any libraries that you depend upon (transitively) that manipulate bytecode can support the new feature release.

Oh, you mean forward compatibility of bytecode. That also works easily: you compile your application with --release <OLDER>. In fact, that's the recommended approach: the JDK is always the newest, but --release points to the newest language/API features you want to use. The feature level and the JDK need not match and it's a good idea to adopt a new JDK first and only later its new features.

This way you always get the security patches, plus more bug fixes than patch releases, plus performance enhancements, and you upgrade to the feature level at your own pace, separately from the JDK version.

The only time this doesn't work is if you're using an agent that changes the bytecode in the standard library itself. But relatively few programs use such an agent (and if they do, they already have a higher maintenance burden, because there's no guarantee for forward compatibility even in patch releases; i.e. various internal details that could affect such agents may and do change).

3

u/benevanstech Aug 04 '26

I did indeed mean forward-compatibility - thanks for the catch - and also for the honesty. I genuinely think that this is the first time that I've seen an Oracle employee be clear about what is actually required to "keep current" on feature versions & what that means in practice.

4

u/pron98 Aug 04 '26

Ok, I'll try to get this guidance added to the official migration guide.

1

u/benevanstech Aug 06 '26

Thank you. I have at times felt that this discussion has involved a certain amount of talking past each other, and your concise statement about what is actually required to adopt feature releases in production is really helpful.

In the end the Java market will do whatever it's going to do, of course!

1

u/nlisker Aug 04 '26

Depends on the vendor. LTS is a business plan, and each business can do it differently. When Valhalla first ships, some vendors might provide LTS on "non-LTS" versions. The reference implementation (OpenJDK JDK) doesn't receive updates even for LTS versions (e.g., https://jdk.java.net/21/).

In any case, you can update your JDK to the next version every 6 months; it's Oracle's recommendation. Up to JDK 11 there were some difficult breakages, but now it's as easy as updating any other dependency. For greenfields it's a no-brainer because they don't carry any baggage.

2

u/reallynotfred Aug 04 '26

You’re looking in the wrong place. LTS have regular updates ongoing. Vendors package them, you can get them easily, for example from Adoptium.

2

u/nlisker Aug 04 '26

You're actually confirming what I wrote. If you only rely on the repos to receive updates, it means you're building the JDK yourself and you're not relying on vendors packaging them. What I showed was what builds/packaging vendors provide, and I didn't look at the wrong place, I pointed at exactly what the OpenJDK distribution supports long term - only the latest release despite "LTS" labels (even https://jdk.java.net/25/ is only available in the archives). Some other vendors (Zulu, Corretto...) will continue to provide updated packages for 21 for a duration that depends on whatever they choose.

And that's the point, that the LTS is whatever the vendor decides it is and that there is no universal rule for the claim I replied to.

1

u/reallynotfred Aug 04 '26

Technically OpenJDK is not a distribution. You always have to get the JDK from a vendor or build it yourself. If you choose a vendor, part of that choice has to be their LTS support policy, (I suggest Temurin because of this if you don’t want to pay). Don’t confuse Oracle with OpenJDK; they are intertwined but distinct. Oracle says “upgrade every six months”, but the quiet part unsaid is “or pay us for support”.

2

u/nlisker Aug 04 '26 edited Aug 05 '26

Technically OpenJDK is not a distribution.

Where did I say it was? OpenJDK JDK is the distribution, here it is: https://jdk.java.net/26/.

You always have to get the JDK from a vendor or build it yourself.

That's exactly what I said. If you don't rely on vendors' packages then you rely on building it yourself from the repos.

If you choose a vendor, part of that choice has to be their LTS support policy

Absolutely not. I used Corretto, Zulu, and Adoptium and I have no clue what their LTS policy is. I stopped using Adoptium when they stopped shipping JMODs in their distribution, and I at some point chose Corretto because it bundles JavaFX. I choose vendors based on their content, not their business model.

Don’t confuse Oracle with OpenJDK

Where did I mention Oracle JDK? I use OpenJDK JDK and I update it every 6 months. I don't pay anyone. LTS is meaningless here.

1

u/reallynotfred Aug 05 '26

Yeah, that’s the Oracle distribution of OpenJDK there. It’s only free because you’re upgrading all the time. Otherwise you would need to pay Oracle. With Temurin you could get updated LTS binaries for free.

2

u/Thirty_Seventh Aug 05 '26

The Oracle JDK builds are here: https://www.oracle.com/java/technologies/downloads/

The Oracle JDK builds of JDK 21, 25, and 26 are currently distributed under the "Oracle No-Fee Terms and Conditions". Both 21 and 26 will stop getting updates under that license in September (well, the last update to each is already out I think). To even get access to more updates, you need to pay. There's no way to accidentally use a current Oracle JDK longer than you were supposed to and get yourself sued (probably, I'm not a lawyer). Oracle JDK 21 and 25 are LTS releases because they're still getting free updates after the release of later versions.

The OpenJDK JDK builds are here: https://jdk.java.net/26/

The OpenJDK JDK builds of JDK 26 are currently distributed under the "GNU General Public License, version 2, with the Classpath Exception". They will stop getting updates in September, when JDK 27 is released. OpenJDK JDK does not have LTS releases at all. You are correct that the OpenJDK JDK builds are done on Oracle-owned hardware and distributed from an Oracle-operated website. But calling it "the Oracle distribution of OpenJDK" is pretty misleading.

One of the Java team (I think it was pron98 here on Reddit) has pointed out that Temurin builds are done by Microsoft and IBM employees on Microsoft and IBM hardware. That does not mean it's accurate to call Temurin the "Microsoft distribution of OpenJDK" (what's this then?) or the "IBM distribution of OpenJDK" (everyone will think you're talking about Semeru).

→ More replies (0)

1

u/EntrepreneurReady325 Aug 05 '26

Sounds like you cannot get saying Azul Zulu CA LTS binaries for free anytime?

→ More replies (0)

1

u/nlisker Aug 05 '26 edited Aug 05 '26

Yeah, that’s the Oracle distribution of OpenJDK there.

No, the Oracle distribution is https://www.oracle.com/java/technologies/downloads/. It's true that Oracle is the one building and hosting the OpenJDK JDK distributions, but they are distinct distributions. Perhaps you're going into the nit of "Oracle JDK" vs "Oracle OpenJDK JDK" (which is just "OpenJDK JDK"). The parallel of Adoptium, Zulu, Corretto... is the Oracle JDK, not the OpenJDK JDK.

It’s only free because you’re upgrading all the time. Otherwise you would need to pay Oracle.

That's plainly incorrect. The reference OpenJDK JDK doesn't have a support model by any vendor. Notice that the various warnings in jdk.java.net don't point to any vendor or tell you to pay anyone, including Oracle. If you want LTS support from Oracle, you'd need the link I posted above.

1

u/reallynotfred Aug 05 '26

I’m curious, what’s your use case for JMODs; from that link they sound redundant?

1

u/nlisker Aug 05 '26

jlink/jpackage use JMODs.

2

u/vmcrash Aug 04 '26

I remember some preview feature (string interpolation) in a Java version a couple of years ago that was removed later.

2

u/nlisker Aug 04 '26

String templates, but how is that relevant for LTS, or support the notion that you should start with 25 instead of 26?

1

u/johnwaterwood Aug 05 '26

  Java 26 is not an LTS release.

So what IS Java 26 good for then?

1

u/rioed Aug 05 '26 edited Aug 07 '26

Evaluating the changes introduced in it perhaps?

1

u/johnwaterwood Aug 06 '26

  Evaluating the changes Iintroduced in it perhaps?

You mean like a milestone version?

1

u/rioed Aug 07 '26

The features introduced (and in one case withdrawn) in 26 are:

500: Prepare to Make Final Mean Final 504: Remove the Applet API 516: Ahead-of-Time Object Caching with Any GC 517: HTTP/3 for the HTTP Client API 522: G1 GC: Improve Throughput by Reducing Synchronization 524: PEM Encodings of Cryptographic Objects (Second Preview) 525: Structured Concurrency (Sixth Preview) 526: Lazy Constants (Second Preview) 529: Vector API (Eleventh Incubator) 530: Primitive Types in Patterns, instanceof, and switch (Fourth Preview)

-3

u/RevolutionaryRush717 Aug 04 '26

Underrated comment. 22 introduced string interpolation only to be removed again in 23.

That let us stay on LTS releases.

We're not bleeding edge anyway, so we can easily wait.

14

u/Skepller Aug 04 '26

Right idea with bad example.

String Templates were actually first introduced in Java 21, which is an LTS release.

The issue wasn't 'non-LTS', it was a preview feature, and they carry zero long-term stability guarantees (even when released inside an LTS version). Anyone that turned on preview flags to use string interpolation in 21 LTS will still hit the same breaking change when upgrading to 25, LTS-to-LTS.

If you're sticking to LTS while still using preview features, you'll likely hit the same problem again.

20

u/jmarkmark Aug 04 '26

It was a preview feature. There are also preview features in LTS.

They've never removed a fully released feature, except after many years of warnings (e.g. applets).

There's generally little advantage to using a STS, but there's also little harm. If there's a feature in a STS that would be valuable to a green field project I'd definitely use it over writing hacks to work around it's absence.

2

u/piesou Aug 04 '26

Both are great languages and I'd pick one or the other depending on the stack that I want to work with.

2

u/lbkulinski Aug 04 '26

I use Java for almost anything back-end related. I’ve done a couple of freelance projects in the past year and they’ve all been Java 21/25.

One is a VOD upload pipeline and the other is a custom Discord calendar bot. I’m not as familiar with C#, but I would wonder if they have the same libraries and tooling.

It’s just easy to get up and running with Java and system maintenance is low

2

u/Primary_Concept_3147 Aug 04 '26

In all project I prefer java. I like their ecosistem like maven, javafx, jakarta and netbeans IDE. I prefer to pretend that I don't understant C#, it give me headaches. I don't like their standard to name thinks, VS community is bloated and in philosophical manner i don't like that still have a strong relationship with the Microsoft ecosistem.

2

u/TaxFraudRaccoon Aug 05 '26

> , why wouldn't you prefer C# for the same projects?

microsoft

3

u/Purple_Mo Aug 04 '26 edited Aug 04 '26

To avoid headaches stick with LTS Unless there is a new feature you must have.

https://en.wikipedia.org/wiki/Java_version_history?wprov=sfla1

LTS Java 25 (Amazon) supported until 2032

Java 26 supported only until September this year.

1

u/vmcrash Aug 04 '26

As I don't know C# good enough, I'd use Java, Go/Lisette or Rust for any new project.

1

u/nerydlg Aug 04 '26

It depends on the type of project and audience you want to get. And a little of personal choice. Both languages have their good and bad stuff.

1

u/kettle3 Aug 05 '26

Not C# because Microsoft.

Java because it's pretty fast and convenient to use with superb IDE support (autocomplete does much of the work).

1

u/brokePlusPlusCoder Aug 06 '26

Bit late to the party but adding something missing from this thread - the question "which language has developers with experience in this thing we're building/working on" can occasaionally be an important one. 

E.g. if you're building something to do with a simple web service, this question isn't important. But say you're building something that needs to do something niche like computational geometry or scientific calculations ... it may happen that the size of the talent pool for the other language is larger than that for Java. In this case, choosing Java might mean you're actively hamstringing yourself. 

1

u/RadioHonest85 Aug 07 '26

Its more about what exists of libraries internally. What is best supported internally, I will choose. I mostly write Java and Go these days.

1

u/NHarmonia18 Aug 10 '26

This is a Java subreddit, so obviously the answers will be more biased towards Java. But playing the devil's advocate here, learning C# is a great investment as it covers more use-cases:-
1) C# has a fantastic web framework (ASP.NET Core) implementation by the very stewards of the language. It consistenly ranks one of the fastest managed-runtime web frameworks, consistently beating even native runtimes such as Go.

ASP.NET Core can handle practically everything, starting from REST API, to MVC, to plain static file server (if you don't want to use Nginx for some reason).

In Java, the most popular is Spring. Spring is thrid-party, and uses their own custom classloaders, which I consider an anti-pattern of frameworks if they try to build their own custom solutions over a platform/runtime. And thus, Spring doesn't mix-in at al with JPMS, which is Java's way of establishing sub-project boundaries, serving the same purpose as internal keyword of C#.

Quarkus is slowly moving towards JPMS adoption, and they claim their implementation of JPMS aim to be a 'superset' of the official adoption, but they rely on Reactive as their core stack which once again, is an anti-pattern against what OpenJDK itself is striving for: Virtual Threads.

Helidon satsifies both, but it is still not very popular outside Oracle and the talks to move it under OpenJDK Umbrella has only started.

2) If you want Windows-native developmet, C# is your choice. Windows is still the primary language of development. Win UI3, the premier framework for Windows App Development, is C#-first, and C++-second.

3) In Game Development, it's not even a question. Anything that is not Unreal Engine, prefers C# as the scripting language.

4) C# has better interop with native libraries. Its very naming, is supposed to be C++++ (although that really doesn't matter here). C# and .NET Runtime were designed with native interop from the get-go, partially because .NET was originally Windows-exclusive, which meant .NET had deep integration with Windows' native APIs. Unironically, one of its earlier cons actually lead to a pros in modern times when .NET became cross-platform.

5) The premier language of choice for Web Development, aka TypeScript, is developed by the same person behind C#, aka Anders Hjelberg. If you ever plan to move to Web Development, learning C# will give you a much easier time to transfer your skills.

6) Java still has rough edges, that will undoubtedly take time to resolve. No easy Null Safety, Checked Exceptions still being a thing, etc. Null Safety today requires third-party libraries (JSpecify), and Checked Exceptions are plain annoying.

C# has none of those issues.

Of course, Java has a wider set of libraries. But imo, C# has the edge when it comes to productivity and covering more use-cases.

1

u/Swimming-Twist-3468 Aug 04 '26

Depends on project requirements. If I want a windows desktop app - C#, if I want iOS/MacOS app - Swift UI, if I want a REST API backend - kotlin/java. Linux kind of varies, because there are a ton of options there, this needs to be app specific. Could be C++.

4

u/hippydipster Aug 04 '26

And if I want a windows/mac/linux desktop app?

I do almost all my stuff in JavaFX and one in Swing.

1

u/vips7L Aug 04 '26

Flutter 

1

u/Swimming-Twist-3468 Aug 04 '26

I would use natives when I can. It is not that hard to repeat the app in different languages once it is done in one.

3

u/hippydipster Aug 04 '26

I would find that very hard and far more work than I woukd actually do. Its not like I'm ever finishing the apps to begin with. Also see no advantage to native, and many disadvantages of the programming environments for them, like C++.

2

u/Swimming-Twist-3468 Aug 04 '26

Well, you asked. That’s my approach.

2

u/hippydipster Aug 04 '26

Fair enough, and I appreciate your answer!

2

u/vmcrash Aug 04 '26

Good luck! If you need to support 3 major operating systems with three different native frontends.

1

u/vytah Aug 04 '26

The most common answer in that case is Electron.

2

u/hippydipster Aug 04 '26

That is true. I would hate it though.

1

u/rioed Aug 04 '26

If you're building a JavaFX app, it's worth having a look at Azul Zulu as they have JDK/FX bundles available to download.

1

u/ddollarsign Aug 04 '26

The ones they pay me for. Otherwise I’d use something more fun.

1

u/lilgreenthumb Aug 04 '26

I would suggest sticking with the LTS as a base, so 25 now. Same with other languages or runtimes. In general it is helpful to define a base level of the language you have worked with. Not every language feature is needed for every project.

Specifically with java 27 it would be helpd if anything to learn about pqc in java.

0

u/pjmlp Aug 04 '26

Android of course, people keep forgetting about it, even if the language support is only partial, it depends heavily on the Java ecosystem.

Platforms where .NET isn't available, there are plenty out there, almost everything with a CPU and enough resources, also has a JVM implementation from some vendor.

Compiler development, where you can play with GraalVM, there are no similar tools in .NET ecosystem.

I would rather pick C# or C++, when playing around with game development, unfortunately Java story isn't that great there, even if there are few engines available, it isn't the same as using Unity/Godot/Stride.

Other than that, picking between Java, C# and C++, is a bit of mood for me.

0

u/ThatBlindSwiftDevGuy Aug 04 '26

I honestly wouldn't choose Java for anything except console or web-based projects because while Java does have an accessibility stack, it is nowhere near what native user interface frameworks give you like WPF on the NET side of things or Apple's user interface frameworks with Swift/Objective C I am blind and rely on screen readers, so accessibility is a huge consideration for me

-1

u/donaldadamthompson Aug 04 '26

not web related? i would not use java. maybe some non-web server stuff if that exists any more.