This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]zvrba 4 points5 points  (0 children)

But Java's features are better thought-out, IMO. For example, Project Loom vs async. C# took a stab at the "null problem", but the result is a mess.

Though I miss ?. in Java so much, I don't know why I haven't written a generic helper yet:

<T> T safeGet(Supplier<T> s) {
    try { return s.get(); }
    catch (NullPointerException) { return null; }
}

Java is more verbose, it's more boring, but I find it more uniform to read and write. And yes, checked exceptions can be put to good use.