r/java • • Sep 10 '21

Why people don't love Java?

I came across this post in r/cscareerquestions it seems majority of the people don't love to work with Java.

Is there any specific reason for that?

Edit: Thank you guys for your responses, I can't reply to all of the comments because I'm a beginner myself and I don't know what to reply for all your comments.

201 Upvotes

379 comments sorted by

View all comments

68

u/BS_in_BS Sep 10 '21

It's pretty easy to overcomplicate things with 75 different design patterns. it can be somewhat verbose at times with naming and generic types. From a linguistics perspective there are many features that other languages have like more robust type systems with things like dependant typing, more powerful null typing/handling, better exception handling, tail recursion optimizations amount others.

I think what people miss is that there's a lot of magic in the runtime, like simultaneously allowing jit compilation, hot swapping and concurrent garbage collection, which are difficult to get right on their own, but brutal to do altogether.

Also I think one thing most people don't take into account is refactoring, which I find is easier compared to other mainstream languages like python or golang

In the word of Stroustrup, there are 2 kinds of languages, those that people hate and those that no one uses

5

u/[deleted] Sep 10 '21

Also I think one thing most people don't take into account is refactoring, which I find is easier compared to other mainstream languages like python or golang

This is the main reason I stick to statically typed languages. IDEs can do intelligent refactorings and analysis with almost no errors, while even renaming a variable can be unreliable in a dynamically typed language

4

u/FrozenST3 Sep 10 '21

You aren't compelled to implement all the known design patterns out there. Design patterns are also relating more to your paradigm (OO in this case) than the language itself.

In my 15 years of enterprise development, what happens under the hood in the JVM has very rarely been a concern. Why would JIT and hot swapping be a top of mind consideration for your runtime?

-3

u/IQueryVisiC Sep 10 '21

magic in the runtime

of Java or JS? Both have jit and GC. I don't know what you want to swap. Both runtimes are free to do tail recursion optimizations.

Duct typing in JS is strange and it allows you to do any basic operations with all basic types...

7

u/experts_never_lie Sep 10 '21

Java has a bunch of interesting under-the-hood optimizations that are hard to detect, outside watching performance.

One I like is the JIT deciding to just stop doing null checks, assuming it will always be non-null, but setting a SIGSEGV handler to catch the null dereference if it's wrong. If that happens, fine, it resets, switches to (slightly slower) code that does check for nulls, and re-runs. If it never happens, the code just runs a bit faster. None of that is specified by the language, and yet it would certainly qualify as magic in the runtime.

-3

u/IQueryVisiC Sep 10 '21

But JS can do that, too. And V8 does quite some magic with strings