On Tue, Jun 5, 2012 at 11:29 AM, Cédric Beust ♔ <ced...@beust.com> wrote:
> On Tue, Jun 5, 2012 at 8:13 AM, Ricky Clarkson <ricky.clark...@gmail.com>
> wrote:
>>
>> There is value in being *able* to go from null to null (or nil to nil or
>> None to None).  The problem is when it's unintentional and that's what we're
>> saying is bad in JQuery and Objective-C, that there's no visual cue that you
>> might be operating on a nil.
>
>
> Absolutely. There are times where I want to be able to write a.foo.bar.baz
> without inserting null checks at every step along the way (and please spare
> me the Demeter nonsense :-)) and times when each of these should always
> return something, so a null return should blow up right away.
>
> Like we discussed, @Nullable and @Nonnull do exactly that. Groovy and Kotlin
> offer similar flexibility (Kotlin with sure()).

I'm not sure how those annotations help here.  In fact, they seem
specifically not to help.  The cases this covers are where you are
passing a @Nullable and would like the result to remain null through
calls.  So, you're back to checking for it.  With Option and the like,
so long as you don't "unbox" the value, you get that ability through
the various methods mentioned.

-- 
You received this message because you are subscribed to the Google Groups "Java 
Posse" group.
To post to this group, send email to javaposse@googlegroups.com.
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to