Stream proposal and null results

Brian Goetz brian.goetz at oracle.com
Thu May 17 18:05:24 PDT 2012


>> Your Scala-bias is showing when you say "push it into the type system",
>> like that is a good thing :)
>
> Scala folk say I'm Java-biased.

My point was, messing with the type system should be a last resort, not 
the first one.  Whatever you're measuring -- compatibility risk, 
engineering cost, time to market, complexity -- adding stuff to the 
language in general, and the type system particularly, is likely to be 
far more expensive than the library-centric alternatives.  Sometimes 
library approaches aren't enough; that's why we're doing Lambda.  But if 
there's a library alternative, that should be preferred.  And Lambda is 
already making plenty of language changes -- some say too many -- but in 
any case, the bar for more must be really high.

So it's really a question of "do nothing" (and live with null sentinels) 
vs "do something in the libraries."  Having getFirst return an Option is 
one of the choices for doing something in the libraries.  (And you've 
suggested some others here.  Let's keep that discussion going.)

I'm not trying to be difficult -- I'm just trying to channel the 
discussion towards something that is actually likely to have an impact.

Cheers,
-Brian


More information about the lambda-dev mailing list