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 · Comments Off on 3 Wishes for JSON · Tags: , ,


Logo for JSON

To be filed under "shoulda-woulda-coulda" and "no-shit-sherlock" and also "forgot-to-write-about-this-fifteen-years-ago"...

I have had to think about XML for the first time in a few years (for the curious, you can read this EPUB bug I filed). If XML had had an array type for simple values (strings), then instead of representing a list of values like this:

<topLevel>
  <myList>
    <item value="abc" />
    <item value="def" />
    <item value="ghi" />
  </myList>
</topLevel>

It could have been this:

<topLevel myList=["abc", "def", "ghi"] />

Would folks have abandoned XML for JSON so quickly?

§1210 · January 11, 2020 · Software, Technology, Web, XML · 1 comment · Tags: ,