3 ms·
> The simplicity of JSON is an advantage: it prevents people from mucking it up with too much nonsense like this. JSONs simplicity was out the window before it
by falcolas 7y ago
> The simplicity of JSON is an advantage: it prevents people from mucking it up with too much nonsense like this.
JSONs simplicity was out the window before it became a formal spec. The original designer of JSON omitted comments from the final spec because people were using them to create processing directives.
There are multiple differing implementations of JSON parsers, the most notable differences between them being some allow comments while others treat them as errors. There's also JPATH, JSON Schema, and JSON Transform.
JSON is the new XML. It has been and will continue to be abused to fit all the possible corner-cases, at the expense of simplicity and readability. Just like XML.
EDIT: Oh, and instead of CDATA, we now simply base64 encode arbitrary objects and pack them into JSON encoded strings. Is this really an improvement?
- unlinked_dll 7y ago>EDIT: Oh, and instead of CDATA, we now simply base64 encode arbitrary objects and pack them into JSON encoded strings. Is this really an improvement? I think that's more of an indictment of HTTP than XML or JSON. Maybe we should have a better standard for exchanging non-textual data with websites.
- dfox 7y agoCDATA still does not allow you to include even arbitrary sequences of unicode codepoints, not to mention arbitrary binary data. On the other hand HTTP is in fact a binary protocol and there is perfectly good way to transport sets of binary objects with associated metadata: MIME multipart/whatever. With multipart/byteranges even being part of HTTP itself and multipart/form-data being one of the "core web technologies".
- delfinom 7y agoNo it's not. It's because people like to just pipe it into same request framework, get a json object and then later do base64_decode(json["binaryobject"]) instead of a separate http request to do binary transport which it can already do.