On Tue, Oct 30, 2012 at 5:15 PM, clay <[email protected]> wrote: > - Option's main advantage is not avoiding NPE's, but factoring common > null-related conditional logic out of all your code and into a standard > library component.
Exactly. I expanded on this point here<http://beust.com/weblog/2012/08/19/a-note-on-null-pointers/> . On a related note, I find it funny when people advocate Option because "it forces you to deal with null pointers instead of ignoring them" and then rant against checked exceptions because they force you to do exactly the same thing. I was also a bit surprised that the whole discussion on Optional in the podcast never mentioned a single time the main benefit of Options (composability) while casually discussing practices that are sure to lead to pain (calling get() or pattern matching on the content of an option), and by extension, discourage people from using Option altogether. -- Cédric -- 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.
