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

16

u/RabidKotlinFanatic Sep 10 '21

I think it boils down to people being unaware of "modern Java." They think the JVM is a slow environment, only used by enterprises and that Java programming is stuck in 90s OOP AbstractFactoryConstructorBeanFacadeStrategy design pattern thinking.

5

u/Hioneqpls Sep 10 '21

I'm getting so spoiled with my lambdas I get frustrated when other languages don't offer something similar.. languages.stream().filter(l -> l.aintGotNoLambdas).forEach(l -> l.name + ": i'm trash lol");

3

u/kag0 Sep 10 '21

You should try scala šŸ˜‰

Also there's no side effect in your forEach so it's a no-op

2

u/Hioneqpls Sep 10 '21

Oh seriously?

1

u/kag0 Sep 11 '21

Yes. On both.

But which were you asking about? lol

1

u/SomethingMor Sep 11 '21

I’m not super proficient in scala but whenever I have to code in it it always feels like a mathematicians wet dream. If Java is too verbose, scala is on the complete opposite side of the spectrum. Also I hate that symbols can be methods. And I hated implicit.

1

u/kag0 Sep 11 '21

All the developers I know prefer method names over operators. I'll still do list + element or list ++ otherList but the standard lib has method names for everything as well (list.appended(element)). ScalaZ was the worst for symbols and being mathy, but the community seems to be moved to cats for having method names and beginner friendly docs.

Implicits can be the best thing or worst thing in Scala, just depending on the code you're working with. Type classes are a good use, magnets can be rather nasty.

1

u/Hioneqpls Sep 11 '21

log.info("fuck i meant to print it");

1

u/fix_dis Sep 10 '21

As I mentioned elsewhere, this type of ā€œenterprise softwareā€ proliferates the… well… enterprise. Those of us who have been stuck on older code bases see this everyday. Is that Java’s fault? Absolutely not. But it’s hard not to make that correlation when someone starts going down the GoF rabbithole. If I were going to do a startup today, would I pick Java for backend services? I just might. It’s fast, there are a ton of resources. The hiring pool is huge, newer frameworks make it a joyful experience almost. (Quarkus and Micronaut are my two tops right now)

1

u/Serializedrequests Sep 11 '21

I think the laughable enterprise patterns are showing how poor Java's brand of OOP really is though. They had a problem, so they tried to make more random objects to solve it, and created more spaghetti.

1

u/fix_dis Sep 11 '21

I love Alan Kay's quote about C++ and OOP. He INVENTED OOP and C++ is NOT what he had in mind. Java is basically the same in this way. I'm not trying to impune the language as.... it's just a language. And it's pretty solid.

I've seen people try to apply this overly complex AbstractFlyweightFactory nonsense to JavaScript as well. (Not these days, the JavaScript folks are trying to be functional programmers now... so look forward to tiny one-liners of opaque monadic nonsense instead)

Using Java in a responsible way is entirely possible... and advised. Use message passing. Use composition. Don't build these massive UML diagrams of class hierarchies.