5 ms·
null != nil !!! It is good to see some partial solutions to this issue. It plagues most languages and introduces a nice little ambiguity that is just trouble w
by rjrodger 1y ago
null != nil !!!
It is good to see some partial solutions to this issue. It plagues most languages and introduces a nice little ambiguity that is just trouble waiting to happen.
Ironically, JavaScript with its hilarious `null` and `undefined` does not have this problem.
Most JSON parsers and emitters in most languages should use a special value for "JSON null".
- pjmlp 1y agoFixed in 1976 by ML, followed up by Eiffel in 2005, but unfortunately yet to be made common.
- afiori 1y agoNull and undefined are fine imho with a sort of empty/missing semantics (especially since you mostly just care to == them) I have bigger issues to how similar yet different it is to have an undefined key and a not-defined key, I would almost prefer if obj['key']=undefined was the same as delete obj['key']