3 ms·
Because most of these languages started from ubiquitous nullability and had to work from there. Also these safe dereference operators are not Option.map, they a
by masklinn 7y ago
Because most of these languages started from ubiquitous nullability and had to work from there. Also these safe dereference operators are not Option.map, they act as both Option.map and Option.flatMap "for convenience". Finally they tend to be method-oriented, which creates namespacing issues & is problematic when their null isn't a dedicated singleton (à la smalltalk / ruby / python).
- TheSoftwareGuy 7y agoI'm pretty sure Python's `None` is a singleton object
- masklinn 7y agoYes? I'm mentioning it as an example of "singleton object" nulls. As opposed to non-object nulls like Java or JS's.
- TheSoftwareGuy 7y agoAhh, whoops. I misread your comment. I thought you were saying the opposite
- masklinn 7y agoYeah I can see where my wording would be unclear, sorry about that.