4 ms·
> Many apps need to index or store or transform arbitrary key/value pairs, but without knowing anything about those keys or values mean. Then those apps should
by colanderman 10y ago
> Many apps need to index or store or transform arbitrary key/value pairs, but without knowing anything about those keys or values mean.
Then those apps shouldn't be interpreting those values. E.g. if you don't know and don't care whether a given JSON number is an integer or a decimal, don't represent it as a number in your app. Just copy the serialized number verbatim (or a canonicalized version thereof).
- lobster_johnson 10y agoOf course, if you're not touching it, that's a fine strategy. But maybe you're transforming it. Or you want to parse it, extract some value and send it somewhere. There are lots of use cases where there's no way around parsing and interpreting the data types in a JSON blob.
- colanderman 10y agoI don't mean the entire JSON structure. Go ahead and parse that; leave the individual values opaque.