I would never understand why people hate Java. Being a java lover I ask them about their reasons, and here are the common answers:
I don’t understand Java. (Well is that really Java’s fault?)
It’s too much boilerplate code. (Well, I agree, but I always love verbose languages. Reason why I also love TypeScript)
“... but, but, but ... you could do that in Python in only 3 lines!” (Have you ever heard of Generics and the Collections Framework ... or lambda expressions?)
The problem I have seen is not that almost everyone will only learn the ancient bits of Java. Most books and online tutorials teach Java in that way. These people never gets to realise that Java has evolved over time to compete with the “modern languages” and have most of those features in one way or the other.
How is it weak and not very expressive? It’s not Haskell, but people created vavr with it and the like. Lombok has nothing to do with expressivity, it’s for boilerplate reduction. And spring is a really complex framework with functionality for everything. It uses DI and the like for modularity. Hell, being able to create such a DI fw is a plus for Java’s strength.
It's so unexpressive that people have to use code generation to build basic stuff like immutable records without pain of creating Builders manually.
Lombok has nothing to do with expressivity, it’s for boilerplate reduction
Boilerplate is exactly the evidence of Java being a very inexpressive language. Patterns are features re-created with code.
When your language lacks important features, you adhere to patterns, hence boilerplate. C programmers use GObject, Java programmers write Builders etc.
The popularity of Lombok and alike proves that it's very hard and tedious to write Java without code generation facilities, helping with boilerplate.
34
u/post_depression Apr 20 '21
I would never understand why people hate Java. Being a java lover I ask them about their reasons, and here are the common answers:
I don’t understand Java. (Well is that really Java’s fault?)
It’s too much boilerplate code. (Well, I agree, but I always love verbose languages. Reason why I also love TypeScript)
“... but, but, but ... you could do that in Python in only 3 lines!” (Have you ever heard of Generics and the Collections Framework ... or lambda expressions?)
The problem I have seen is not that almost everyone will only learn the ancient bits of Java. Most books and online tutorials teach Java in that way. These people never gets to realise that Java has evolved over time to compete with the “modern languages” and have most of those features in one way or the other.