Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
You can't really compare Java to .NET. Apples and oranges. (You can compare the JVM to .NET, or you could compare Java to C#.)
What are you trying to achieve?
mampf2002yIf you mean JVM languages vs .NET languages it really depends.
Java is still powering business, and support for application servers and the JVMs is excellent.
Kotlin is a cool new language which will spread eventually, bit unlike scala is kept somewhat simple and is fast.
.NET on the other hand is not used much on Linux, although C# has a nice syntax.
As a good java Dev or JVM engineer, you can earn a lot of money.
Me, honey 💁♀️💁♀️
I strongly disagree.
C# in my country has over 70% of the market and is paid better.
Not to mention that Oracle is effectively trying to kill Java with Google lawsuits, licensing chaoses etc.
But to put it into reasonable arguments:
- Java is too verbose, something that takes 10 lines to write in Java, takes 2 lines in C#.
- Each C# update improves syntax, reducing the amount of code you have to write to achieve the same results quicker.
- Java is behind with all the cool stuff compared to C# - for example: lambdas: C# had them since 2007, Java had them since 2014.
- Java has no bitwise operations.
- Threading in Java is miserable.
- Java has way better reflection in terms of efficiency.
- C# .NET Core makes it easy to write apps for Linux, but Java is still more common to use on such OS.
You can get rid of most of my arguments if you use a Java-derived language like Kotlin or so, but end to end it just reduces amount of jobs you can find.
@HelloUglyWorld "C# in my country has over 70% of the market and is paid better."
Where do you live? That's rather rare.. most places I've seen (especially in the UK) have a greater share of jobs based in Java, and the pay is usually comparable between roles.
Java's certainly behind on the "cooler" features, but that hasn't affected its real world usage much.
And as an aside, your reasonings are not completely correct - Java has always had bitwise operators, for example.
- *Some* things are certainly more verbose in Java than C#, but not everything. (Boilerplate code is a lot more verbose, but the introduction of lambdas in Java has fixed most other cases of that.)
- Java updates also add new syntax (just not at the rate of C#.) `var` is a reasonably recent addition for instance.
- Java reflection isn't particularly efficient either. (It's not really meant to be an efficient thing in either language, you'd generally only use it as a last resort.)
- Nitpick: While you can technically use C# on Linux, in reality, no-one I know uses C# on anything other than Windows in production.
Java's certainly not perfect, and trust me I get more frustrated with it than most! In particular, the Java 11 module changes have brought a *lot* of headache, and pretty much everyone I know is still sticking with Java 8 as a result. It'll be interesting to see how that develops.
@stillwater The Java release cycle has changed to every 6 months after version 9.
@HelloUglyWorld Partly. I think the only one there that really comes down to experience is .NET core being used in the real world, hence my note that was a nitpick.
The question as to whether Java will continue to evolve in the future or whether it'll just become legacy is a very interesting one, but not one that can really be predicted at the moment. Both myself and many others would love to have a clear cut answer on that one.