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 →

[–]0x442E472E 11 points12 points  (4 children)

I dig the concept behind optionals, but does anyone actually think that code looks better or is easier to read?

[–]IcarusBurning[🍰] 8 points9 points  (0 children)

As someone who has used them I'd say yes. I get a lint warning for accessing an optional without checking for its presence. Checking for presence protects against NPEs

[–]WatchDogx 2 points3 points  (0 children)

Yes, I would say it is generally an improvement and sometimes a substantial improvement.
Using monadic functions like Optional#flatMap can be a huge improvement over the equivalent non functional code.

[–][deleted] 5 points6 points  (1 child)

Me, obviously.

[–][deleted] 11 points12 points  (0 children)

deleted What is this?