Skip to content

Archives

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)

1 Comment