{"id":11850,"date":"2015-07-28T09:57:16","date_gmt":"2015-07-28T13:57:16","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=11850"},"modified":"2015-08-01T11:09:12","modified_gmt":"2015-08-01T15:09:12","slug":"why-json-doesnt-have-comments","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/07\/28\/why-json-doesnt-have-comments\/","title":{"rendered":"Why JSON Doesn&rsquo;t Have Comments"},"content":{"rendered":"<p><a href=\"https:\/\/groups.yahoo.com\/neo\/groups\/json\/conversations\/topics\/156\">Douglas Crockford<\/a> (via <a href=\"https:\/\/pinboard.in\/u:ddribin\/b:b9f9fbd16187\">Dave Dribin<\/a>):<\/p>\n<blockquote cite=\"https:\/\/groups.yahoo.com\/neo\/groups\/json\/conversations\/topics\/156\"><p>First, comments turned out to not be very useful.<\/p>\n<p>Second, comments were the most difficult feature to support in JSON\nparsers. By removing comments, support for JSON in other languages\nbecame much easier.<\/p>\n<p>Third, removing comments aligns JSON more closely with YAML, allowing\nYAML to become a JSON superset. Generally, standards tend to splinter.\nIt is interesting to see these two merging.<\/p>\n<p>Fourth, I saw examples of comments used to carry information, with an\nexpectation that applications would have to have custom comment\nparsers and generators. That was not a pattern that I wanted to encourage.<\/p><\/blockquote>\n<p><a href=\"https:\/\/plus.google.com\/+DouglasCrockfordEsq\/posts\/RK8qyGVaGSr\">Douglas Crockford<\/a> (via <a href=\"https:\/\/pinboard.in\/u:ddribin\/b:29c36d9cfe8a\">Dave Dribin<\/a>):<\/p>\n<blockquote cite=\"https:\/\/plus.google.com\/+DouglasCrockfordEsq\/posts\/RK8qyGVaGSr\"><p>I removed comments from JSON because I saw people were using them to hold parsing directives, a practice which would have destroyed interoperability. I know that the lack of comments makes some people sad, but it shouldn&rsquo;t.<\/p><\/blockquote>\n<p>Update (2015-08-01): <a href=\"https:\/\/news.ycombinator.com\/item?id=3912149\">Hacker News comments<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Douglas Crockford (via Dave Dribin): First, comments turned out to not be very useful. Second, comments were the most difficult feature to support in JSON parsers. By removing comments, support for JSON in other languages became much easier. Third, removing comments aligns JSON more closely with YAML, allowing YAML to become a JSON superset. Generally, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[295,346,507,71],"class_list":["post-11850","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-history","tag-javascript","tag-json","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=11850"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11850\/revisions"}],"predecessor-version":[{"id":11902,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11850\/revisions\/11902"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=11850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=11850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=11850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}