Files
static-site-pipeline/hugo/content/posts/2018-06-02-json-comments.md
2023-09-30 18:34:20 +01:00

1.0 KiB

lastmod, author, categories, comments, date, title, summary
lastmod author categories comments date title summary
2021-09-12T22:47:44.0000000+01:00 patrick
hacker-news
programming
true 2018-06-02T00:00:00Z JSON comments (a note from Hacker News) A quick note from Hacker News about why the comment-handling situation in JSON is bad.

In response to a linkpost to an article about how YAML isn't perfect, user jiveturkey commented with confusion:

JSON doesn't support comments

eh?

{ "firstName": "John", "lastName": "Smith", "comment": "foo", }

I know it isn't the same as #comments, but who cares really.

I replied:

The trouble there is that your comments come in-band. What if you're trying to serialise something and you don't have the power to insist that it's not a dictionary with "comment" as a key?