3 ms·
One aspect about JSON is the lack of comments. This makes it mostly unsuitable as a configuration language and in fact simple "JSON for humans" such as https://
by ktpsns 8y ago
One aspect about JSON is the lack of comments. This makes it mostly unsuitable as a configuration language and in fact simple "JSON for humans" such as https://hjson.org/ https://hjson.org/ and https://json5.org/ https://json5.org/ exist. In my opinion, this is a design flaw and if JSON would be a bit more human-oriented, it could be much more widespread in non-web contexts.
- fenwick67 8y agoI actually like that JSON has no comments. With comments in a data transmission format you will end up with things like "conditional comments" in IE. I agree there are certainly many better configuration languages.
- ktpsns 8y agoI agree, but you can do context switchs also without having comments. For instance, the JSON Schema defines (Source: https://json-schema.org/latest/json-schema-core.html#rfc.section.9 https://json-schema.org/latest/json-schema-core.html#rfc.sec...) { '$comment': "string that can hold whatever you want" } and it is obvious that you can embed any other language in a string.
- rurban 8y agoIt is not design flaw, it was a conscious decision to enhance security. JSON is still the only secure (and fast) generic transport protocol, all others but msgpack are insecure by design. The various attempts to "enhance" json with types, datetime, comments, ... just make it worse, don't fall into that trap. The latest JSON changes also made it more insecure, while they didn't clarify the missing spec points, so even they fell into that trap. msgpack is more also a bit insecure than JSON, but not as dramatic as XML, YAML, BSON, ...