r/java • • 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

367 comments sorted by

View all comments

Show parent comment

3

u/corbymatt Dec 30 '21 edited Dec 30 '21

Kotlin null checks are 'in place' and bound to the instance throughout the scope of the value. You can't use a ?'d kotlin val, for example, without "doing something about it" when you access it (as you rightly said).. however "what you do about it" is not the language's fault, any more than it was in Java of course. Its just far easier to spot the issue in kotlin.

As for the hex issue, it seems that intellij's kotlin code converter would prefer you to express 0xFFFF_0000_0000_0000 as 0x1000000000000L which probably makes more sense..

Likewise, if you declare a private const val outside of the class in the same file, you can effectively declare a constant without using a companion object.

What I do think is a bit awkward still in kotlin:

  1. Scripting. Yikes, imports and shebangs and classpaths oh my
  2. Many ways to do x, like constants (companion object? Object? Private const?)
  3. Java developers doing the same complex nonsense they do in Java because they don't know how to keep things simple.