Links for 2019-10-01

  • JSON originally had comments. They were removed

    Oh christ. This is some terrible logic from Douglas Crockford:

    Comments in JSON (Apr 30, 2012) 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’t. Suppose you are using JSON to keep configuration files, which you would like to annotate. Go ahead and insert all the comments you like. Then pipe it through JSMin before handing it to your JSON parser.
    I’ve never even _heard_ of JSMin. Meanwhile various tools which chose to use JSON as a configuration file format work around this crappy decision with messy hacks.

    (tags: hacks json bad-decisions design apis configuration file-formats javascript douglas-crockford fail jsmin parsing comments)

This entry was posted in Uncategorized. Bookmark the permalink. Trackbacks are closed, but you can post a comment.

One Comment

  1. Craig
    Posted October 3, 2019 at 00:29 | Permalink

    { "actual_data": {...}, "comment": "Hello world!" }

Post a Comment

Your email is never published nor shared. Required fields are marked *

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*
*