2 ms·
To expand on what the other commenter said. The creator of JSON was explicitly against comments for a few reasons. The biggest one was that comments are often
by Klathmon 10y ago
To expand on what the other commenter said.
The creator of JSON was explicitly against comments for a few reasons. The biggest one was that comments are often used to "extend" a format. Look at doc-block, annotations, etc...
In order for the format to work, everyone had to use the exact same set of rules, and that meant that if people started adding their own "crap" to the format in a "backwards compatible" way you'd lose what makes it special.
So he didn't add comments. And I personally think it worked out.
- azeirah 10y agoAh ok, I hadn't considered that, that's quite clever really.
- dv_dt 10y agoSo now lots of JSON parsers have extensions to ignore comment extensions to the format...
- legutierr 10y agoThis argument against the inclusion of comments is a good argument in favor of the inclusion of a date data type and a binary data type. Right now, there are a number of different ways to encode both types of data, and you see them all in the wild. And extra custom serialization and deserialization steps are always required to handle them.