DEV Community

A.R
A.R

Posted on

J.son is not worth

__
JSON can be verbose, especially for large datasets. This verbosity can make JSON files larger than other data interchange formats, leading to increased bandwidth usage.
The lack of comments in JSON can make it challenging to add explanatory notes or annotations within the data.
No Comments:

JSON does not support comments, which can be a limitation when documenting or explaining the data structure.
No Support for Binary Data:

JSON is a text-based format, and it does not provide built-in support for encoding binary data. This limitation can result in inefficiencies when dealing with binary data compared to formats like Protocol Buffers or MessagePack.
Limited Data Types:

JSON has a limited set of data types (string, number, boolean, array, object, null). While this simplicity contributes to its ease of use, it might not be as expressive as other formats in certain scenarios.

Top comments (5)

Collapse
 
miketalbot profile image
Mike Talbot ⭐

What data transfer types support comments? XML? Ugh.

JSON advantages: human readable, human editable, and concise compared to XML. Pretty easy to build a scheme on top of JSON to store object types if needed.

Agreed it's not great for binary data, so if that's a big requirement it's probably better to find another way. Encoding binary data works in a pinch.

Collapse
 
arocha profile image
Nefario313

Before the popularity of JSON, XML where everywhere but the raise of Restful service and the cost for processing XML makes JSON "dominant" in the market. It is not suite for all the problems but, until another candidate came up, it is currently the most used data format.

Collapse
 
moopet profile image
Ben Sinclair

Saying that the lack of support for binary data is a weakness is a bit weird.

If you really want to, there's nothing stopping you from encoding data as base64, but the fact that JSON is textual is a feature, not a bug. It means the format is mostly transparent. Sure, it doesn't contain a reference to the schema like XML does, but you can generally examine a JSON file and figure out what it does, and how to extend it.

Binary data formats have their place, but are also hugely problematic when used by companies deploying proprietary code which will be unmaintainable and effectlively lost to the world as soon as the company ceases to trade.

Collapse
 
efpage profile image
Eckehard

No comment!

J. Son

Collapse
 
sreno77 profile image
Scott Reno

What do you propose we use instead of JSON?