|
|
|
|
|
by _sdegutis
3000 days ago
|
|
Objective-C also allows nil to receive messages which then just returns nil also. I’ve always found this really natural in that you can assume something is either valid or null and avoid a whole lot of null checks this way. That said, I’ve never been terribly frustrated by other languages either which throw when calling methods on null. Maybe it’s because of heavy use of certain design patterns that make it so it’s never really a surprise? |
|
All in all, I'd like to have some kind of "?" operator in Python, I do think the pros are most of the time greater than the cons.