3 ms·
Assume your graphQL use case is working with stored graphQL operations. Once you add this special meaning of null, null is no longer infrequent in the data itse
by foolmeonce 6y ago
Assume your graphQL use case is working with stored graphQL operations. Once you add this special meaning of null, null is no longer infrequent in the data itself, so using null to represent delete is a good idea on the existing data and then a bad idea once implemented (is this an attempt to delete a part of a query or is the query a delete query, or both?)
A new patch must follow, etc. Homoiconic languages and channel protocols are crafted to avoid this kind of meta rat races with their own representation.
null is actually the null object, so if an object is not expected the use of null is wrong, a key should exist but it's value is undefined. AFAIR even most DOM operations are correct in this distinction.
undefined as a value does not mess with Object.keys or hasOwnKey.. it truly is what it claims to be and is truly distinct from a never existing value in JS.
JSON is buggy, but we knew that. Trying to get metadata on the data channel instead of the opposite is buggy, but we knew that too.
Better things exist to implement a proper interface today, i.e. one can use Symbol to distinguish current runtime metadata that truly can not collide with the data.
- hn_throwaway_99 6y agoTBH I can't follow the point you're trying to make, at all.
- foolmeonce 6y agoTLDR, I view this as the metadata treadmill: A> Using X to mean `delete` is using up X such that you can't work on items that use X. B> I checked and no one really uses X. A> now you use X! B> I checked and no one really uses Y, I'll use Y for X where X would have really meant X. .. It doesn't mean null is good, it is simply available. A good meta has entirely different properties than null and those properties get you out of that treadmill.