4 ms·
JSON gets the most important thing right: it's simpler than XML. I probably should have rephrased my comment. I literally mean that it's a decent format, but no
by hyperpape 9y ago
JSON gets the most important thing right: it's simpler than XML. I probably should have rephrased my comment. I literally mean that it's a decent format, but not a great one.
One issue is that it's surprisingly poorly specified: http://seriot.ch/parsing_json.php http://seriot.ch/parsing_json.php.
As a data-interchange format, it lacks first class dates/timestamps, the issues about specification are a pain when dealing with numbers (depending on language, you may not be able to use the full range of 64 bit ints), and has no builtin concept of schemas. That said, I'm not sure what I'd recommend above JSON, though you clearly wouldn't use it for really high performance servers.
It's also used as a configuration language, where more issues surface. It doesn't accept trailing commas or comments (I can see the argument for requiring all keys to be quoted, but that's a pain to write as well). For configuration, I think I prefer TOML to JSON. Dhall looks cool, but I've never used it.
- hutzlibu 9y agoYes, your criticism is very valid and I agree to it - I still think JSON is a great (simple!) format, though. And I hope, that all the missing things like schemas can and will be added at some point, when there is a consensus on how ... And TOML and Dhall look interesting, but I like the block approach with brackets to data like JSON does it.
- Spivak 9y agoI think it's weird to criticize JSON the format for lacking these specific features. I think there is absolutely an argument to be made that its simplicity often means that it's not the right tool for the job. There are a lot of developers who are stuck on making JSON do horrible things and end up reinventing the wheel poorly because 'XML is gross' but I wouldn't say the right answer is to add these features to JSON.