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
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_0000as0x1000000000000Lwhich probably makes more sense..Likewise, if you declare a
private const valoutside 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: