Java developers introduced Optional for this very case, but Optional's API enforces stream style constructions. Moreover you must handle nulls sometimes (foreign API calls), and then you might run into type checking problems, NPE when put into a Map.of() etc.
For me the given examples from Smalltalk are more appealing. I would trade null for nil, or at least have some nullsafe construction like .? in swift
For me the given examples from Smalltalk are more appealing. I would trade null for nil, or at least have some nullsafe construction like .? in swift