Logo for JSON

The elder days of my blog are littered with useless musings on XML and JSON. So why not throw another one on the pile? 🙂

I wish JSON supported:

  1. Multi-line strings (but no string interpolation)
  2. Trailing commas (in arrays and object property lists)
  3. Comments

Of course none of these will probably ever happen, but having any of these three would keep JSON wonderfully simple but vastly improve the user experience of those who have to hand-tweak JSON files (which is a lot of people!). I kept these feature requests to only things supported by ECMAScript itself. I also note that several parsers seem to accept JSON with #2 and #3.

YAML has all these, but of course it has many other features that, I assume, make it burdensome to write a fully compliant parser.

[Update Jan 2023: I finally filed a bug on VS Code for this idea of back-ticked string support in their tasks.json. Maybe it's crazy, I haven't decided... but feel free to vote it up!]

§1306 · October 26, 2022 · JavaScript, Software, Technology · (No comments) · Tags: , ,