Glaring omission from JSON Spec.

2009-03-06 − 🏷 data formats 🏷 javascript

JSON has become a popular data-exchange format lately, and it's even been adopted as a config format by some. It's apparently useful for this, with an easily definable syntax, and fairly simple to understand for the en user. However, one factor that could hamper the adoption of JSON is the lack of comment support. This is a really strange omission. After all at JSON is really just a Javascript data structure, and JavaScript does support both the // and /* comment */ style.

In any user-editable text, comments is useful both to explain sections, and to temporarily disable a section. I've been looking for a new generic data structure representation to replace YAML, and JSON seemed like a really promising candidate, until I found out about this limitation.

*Update: The plot thickens. According to the JSON Wikipedia Page, the JSON spec used to include support for /* comments */ (c-style). Seems they changed it. Conveniently, this helps to make JSON a YAML subset. I'm pretty sure it is not worth that tho. Anyone have a link on the process that resulted in this?*