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.
Instead you see a nil 5 miles away in code that has been working for years, with no real clue as to where it comes from. On Jun 5, 2012 12:09 PM, "Josh Berry" <[email protected]> wrote: > On Tue, Jun 5, 2012 at 10:57 AM, Cédric Beust ♔ <[email protected]> wrote: > > JQuery does the same thing: selectors return arrays of matching elements, > > but if no elements were found, you receive an empty array instead of > null. > > Anyone who thinks this is a better idea hasn't practically worked with > the > > concept. > > > > Failing fast (with an NPE or, in the case above, with a Javascript error > > regarding 'undefined') saves much more time than silently proceeding > with an > > unexpected result. > > Isn't this really just making nil/null a true bottom type? I see > Groovy explicitly introduced the "safe navigation" operator to allow > this. I can see where it would have its uses. > > -- > You received this message because you are subscribed to the Google Groups > "Java Posse" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
