3 ms·
I have a silly question, only having used JSON a precious few times, but if people want comments in JSON, couldn't that be done just by a named field within an
by diydsp 13y ago
I have a silly question, only having used JSON a precious few times, but if people want comments in JSON, couldn't that be done just by a named field within an object that follows the existing specification, iow an optional property holding a string?
- MichaelGG 13y agoBy doing that, you've now added more data to the object. It'd be like doing <tag comment='bar' /> in XML - the actual data has changed. So you'd end up defining some well-known comment name. But then you can't serialize arbitrary data structures, because they might conflict. So that gets complicated. After everything, the JSON spec could have allowed comments to stay in. Instead, the author went off on some nonsense reasoning about incompatibility.