by anentropic · 1y ago · 0 comments
https://layer8.space/@douglascrockford/113595316189101091
> If the comment is important enough to be put in the text and remembered, then make it an explicit part of the data structure. That will also make it easier for tools to find it and process it in a useful way. {"comment": ...}
> Use a preprocessor tool such as jsmin to remove the commentary before passing it to a JSON parser.
I kind of wish JSON had trailing commas though
either it's a data transfer format and comments should be stripped before transmission
or the comments are part of the data model
makes you have to think clearly whether the comments are just "notes to self" at authoring time, or something relevant to the consumer
OTOH of course there are plenty of 'greyer' cases