3 ms·
> The existential operator `?` soaks up null/undefined references. This seemingly minor feature is so huge for me. Accessing deep objects?.is?.a?.horrible?.pai
by o_____________o 12y ago
> The existential operator `?` soaks up null/undefined references.
This seemingly minor feature is so huge for me. Accessing deep objects?.is?.a?.horrible?.pain?.sometimes?()
- T-hawk 12y agoIf you're accessing objects that deeply, something is breaking the Law of Demeter about locality of reference and looseness of coupling. It's a syntactic convenience, but it leads to questionable patterns. Do you really want to silently collapse the hierarchy of whatever was null? I'd rather identify it and fail with a specific message or behavior rather than generically.