3 ms·
Comments were intentionally excluded to prevent the use of parsing directives. (Sadly, Crockford's post about this reasoning was on Google Plus and is no longe
by dharmab 2y ago
Comments were intentionally excluded to prevent the use of parsing directives.
(Sadly, Crockford's post about this reasoning was on Google Plus and is no longer online.)
- sargstuff 2y ago{comment : "your comments here!"} {copyright comment : "JSON doesn't require/enforce specific comments is a good thing" } {comments : "JSON parser is not an 'comment' editor! } Don't know whtat the google plus article covered, but Crockfor's comments : https://www.linkedin.com/posts/douglas-crockford-724600109_json-does-not-have-comments-but-you-need-activity-7270098484127510529-y83I https://www.linkedin.com/posts/douglas-crockford-724600109_j...
- ASalazarMX 2y agoI think the spirit is forbidding creative developers from using the comments to include active content. I know people who if struggling with datetime encoding, would add a "// DATEFMT: YYYY-D-M" comment and be on their merry way, making it incompatible with all other JSON parsers.
- sargstuff 2y agoWhat might be nice is to add a prefix to key name that indicates 'this is a 'internal document reference', skip this unless quests to parser to not ignore. Would allow for describing encoding method(s) used. date format comments being very helpful. Technically, can do by just dropping by key name. Why comment on a format vs. adding an associated "key""format" with format information. aka date : 25.02.04 date-fmt : YY.DD.MM