3 ms·
JSON is by far not the universal exchange format. There are plenty of use cases where JSON is not well suited, such as: - regular/tabular data where JSON fails
by ktpsns 6y ago
JSON is by far not the universal exchange format. There are plenty of use cases where JSON is not well suited, such as:
- regular/tabular data where JSON fails at processing speed and/or compressibility. One of the most efficient ways to store for instance a table/array of numbers is packing them as binary IEEE754 stream.
- encapsulation of other code. Ever put HTML in a string within JSON? It's terrible to read and maintain for a human due to all the escaping. If you ever embedded SVG into XML/HTML or XML/HTML in JSX, you know how easy it can be if you don't have to break your head about escaping.
- Obviously there is a need for binary json (there exist a lot of proposals/standards). That's quite similar to protocol buffers. The reason is always something about performance.
- Also there are folks arguing since decades about JSON vs. XML vs. YAML vs. TOML vs .... There are lot of different opinions, and it is hard to say some is superiour to the other.
- cryptica 6y agoTrying to standardize binary as a flexible and general purpose interchange format is unwise IMO. UDP and TCP (and other protocols at that level) are about as far as we can standardize binary formats - This is as specific as they can be whilst still being generally applicable to a wide range of use cases. My problem with ProtoBuf is that you can't impose more a more rigid structure and get more compatibility at the same time. A more rigid (statically typed) structure is inherently less compatible/interoperable (requires more integration effort, not less; harder to debug, not human readable, not searchable etc... More integration effort = less compatible, less interoperable).