Loose ends: Optional
Brian Goetz
brian.goetz at oracle.com
Sun Jun 2 12:50:43 PDT 2013
> They are harmful, by example, flatMap use a function that returns an Optional,
> if people use the same function in a stream, the result is collections of Optional
I think now we're finally coming to your real objection -- the moral hazard of "if we give people Optional, they might misuse it, so let's not give it to them, or at the very least, let's cripple it."
> something we said we want to avoid.
It is something we want to avoid -- I will certainly avoid it in my code, and criticize any code I see using this (or any of ten million other bad programming techniques.) The world is full of useful tools that that interact dangerously, such as bleach and ammonia or toasters and bathtubs. We're not going to outlaw any of these just because mixing them is dangerous.
More information about the lambda-libs-spec-observers
mailing list