r/programming • • Apr 16 '21

Java is criminally underhyped

https://jackson.sh/posts/2021-04-java-underrated/
41 Upvotes

220 comments sorted by

View all comments

43

u/Jwosty Apr 16 '21 edited Apr 16 '21

So this article is mainly a comparison between Java and Javascript/Typescript, with the following pro's listed for Java:

  • Good IDEs

  • Static typing

  • Good standard library

Which, I grant the author, are true -- when compared to Javascript/Typescript.

However Java isn't the only language that has these advantages. See many other static languages such as C#, C++, etc. And if you want to get the best of both worlds from static typing (correctness and safety) and dynamic typing (readability and brevity), we do have languages with static type inference (Scala, F#, OCaml, etc). Why not those?

UoC must be weird, because at my school, we mainly used Java for courses, as the sort of default choice, as many many college do... I definitely don't miss it.

Call me a C#/.NET fanboy or whatever you want, but you can't deny it's a faster innovating and generally cleaner language and runtime (generics at runtime, async/await, non-nullable types, tuples -- gosh, Java doesn't have a standard tuple type!). Checked exceptions are a disaster. And don't even get me started on all the interfaces in Java that have "optional methods" -- why include it in the interface if it's even documented that some implementations will just throw UnsupportedOperationException (I understand that some of this antipattern exists in .NET, but they're few and far between compared to Java's std lib).

In summary -- Java is just so boring. It's always the last to get modern language features; it almost never blazes the trail. Java didn't even have first class lambdas until Java 8 IIRC.... Java is criminally lagging behind. Java is death by committee in action.

0

u/[deleted] Apr 16 '21

[deleted]

9

u/Jwosty Apr 16 '21

It's had so long to get out from under C#, too, and still hasn't. IMO the main thing the Java ecosystem has going for it is Scala, which is a legitimately awesome part of that world. Well, that, and great hot-swap debugging.

5

u/Nacimota Apr 16 '21

How do you feel about Kotlin? I've never really tried it, but the pitch there also seems to be "Java but with the problems fixed". From what I've seen, it definitely takes some cues from C# as well.

1

u/HawocX Apr 23 '21 edited Apr 23 '21

I haven't used it either, but from checking out it's features and syntax it seems like a more modern C#. As a mainly C# dev I wouldn't mind using.

As a side note, Swift is very similar to Kotlin as long as you look at only the language itself.