On Friday, 28 February 2014 at 09:24:23 UTC, John Colvin wrote:
Chaining . operation is a code smell to begin with

It is? Why?

If a system is well-designed, then "null" state either means something (and needs to be explicitly handled) or is not possible.

?. provides simple and easy way to write a sloppy code that does not tell the reader if resulting code flow for null case was intentional. Also it is very easy to get accustomed to use ?. everywhere instead of . and get broken logic instead of NullPointerException for cases when pointer is wrongly assumed to never be null.

Reply via email to