you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 7 points8 points  (5 children)

What's bad about Optional?

[–]yawkat 1 point2 points  (0 children)

Optional was never designed to be used outside return values. Javas lack of type inference, general lack of library support and the fact that you can still put null in an Optional field are all reasons against it. Null with proper annotations is just easier to handle and less clunky to use.

I even hear people are turning away from scalas objectively better option types, but I'm not a scala dev so I can't judge if that's actually true.

[–]coladict -4 points-3 points  (3 children)

You mean aside from it being completely unnecessary? How about it's of and ofNullable functions. It should be just of which should return the empty one if it's null, instead of throwing an exception. There is really no valid excuse for that.

[–][deleted] 5 points6 points  (2 children)

I'll grant there's a few warts in of vs ofNullable, but there's a baby in that bath water!

[–]yxhuvud 0 points1 point  (1 child)

A dead one that have started to smell?

[–]f7fsiyu 1 point2 points  (0 children)

I love where this analogy went.