Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's a false dichotomy. JSON could have comments and not be ambiguous like YAML.

In fact: there exists a specification called JSON5 which does include comments.

But I agree that it would've been nice if it had comments before it achieved a critical mass of adoption.



I've read the opinion that comments were omitted from JSON in order to forestall hacky round-trip conversions to/from other formats (like XML).

Can anyone confirm/deny ?


The primary reason why JSON does not support comments is that its creator, Douglas Crockford, deliberately removed them from the format to prevent misuse and keep it as a pure data-only format.

Crockford observed that some people were using comments to store parsing directives, which could break compatibility between different systems. Hence, the decision to remove comments to maintain the simplicity and consistency of the format across various programming languages and environments.

https://www.freecodecamp.org/news/comments-in-json/

I vote for the minimalist heretic.

https://www.infoq.com/presentations/Heretical-Open-Source/


I don't think they were saying that's an issue of comments, just an issue of yaml vs json.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: