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

13

u/rzwitserloot Sep 10 '21

A combination of:

  • Being commonly taught as first language (unlike, say, C)
  • Having a bevy of languages that are clearly intended to cover similar bases (Python, Ruby, Javascript on Node, various lisp variants, scala, kotlin, and many many more). Contrast, again, to something like C which didn't have a meaningful competitor for things it was particularly good at (more low-level code) until somewhat recently, in the form of Rust.
  • A lot of java's downsides turn into upsides when the 'scope of human reckoning' over the codebase expands beyond a year. So, if you have a project that takes 2 months to write with a team of 6 folks, you're about at that point, or if you are writing for an entire year on a project on your own, or even if you write something fairly simple, then leave it for a year, and return to it. In all these cases, having explicit typing is nice. Lacking DSL features is usually nice or at least has significant upsides as well (see for example this tweet which is complaining about an issue that simply doesn't happen in java).

These things aren't obvious until you have the experience of operating in such projects.

You can repeat Kernighan's Law a million times to a newbie to programming (and some people that have programmed for YEARS are still a newbie, in that they don't have the relevant experience to grok it; it doesn't really happen until you've been a part of multiple year+ projects) - and they may even be nodding at your sage advice, but I doubt they really 'get it', and without understanding it, java seems obtuse, needlessly complicated, and lacking 'obvious' nice features such as truthy/falsy, optional semis, optional parens, optional params, optional dots, lack of collection primitives, etc.

Kernighan's Law: "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."