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.
