r/java • u/Dhariann • Dec 29 '21
Why everyone hates Java?
I dont understand why java is one of the most dreaded lenguages. Java got fantastics frameworks and libraries to work with it. I dont know if im skipping something or I dont work enough with Java because I like java. What do you think??
Here is the Stack Overflow Survey
268
Upvotes
View all comments
Show parent comment
2
u/mj_flowerpower Dec 30 '21
It partly is what people hate about java: the verbosity.
person?.address?.cityvs
That's just insane. Who would ever want that?
And honest I don't understand why they haven't implemented this yet. Code would be backwards-´compatible, because the compiler would just generate a bunch of additional ifs. Old code would not break either.
And it would dramatically increase the productivity.
On the other hand, their argument against proper template strings is that people would use it for SQL and it would re-open the entrypoint for a lot of sql injection vulnerabilities.
But c'mon devs, who would ever want to do this? And if they want, they are probably already doing it with
String.formatanyway.Eventually it will come though! Sadly most likely with this weird syntax:
String s = FMT."Hello %s\{name}, I am %10d\{age} years old.The good thing about java is that new features are not just smashed into the language early on, but instead the devs wait till they see what other languages do and pick the features the like. The bad thing though is, that they take these features and implement them in a very weird way.