This post was published on Thursday 24th of March 2005.
After some correspondence with Douglas Crockford, the guy behind JSON, it's all been cleared up. It seems I was a little hasty and didn't read so carefully. The idea is that this notation can serve as a format to interchange data between languages, like XML, only more compact.
One downside I see is that with XML we have had very smart people thinking about stuff like DOM and XPath to make handling the format easier. Such ideas can be implemented for JSON as well, I'm sure. It would be a whole lot easier too, I guess. I wonder if Crockford is working on that as well.
What follows is my original post:
Ok, I'm stepping into Hixie's footsteps here, but I really don't get the need for a new name here. JSON is apparently an effort to make people aware of a standard feature of the JavaScript language: you can define objects as an associative array:
// Compare this:
var o = new Object();
o.prop1 = 'a String';
o.prop2 = 1234;
// To this:
var o = {
prop1: 'a String',
prop2: 1234
}
I can see the usefulness of giving a new name to a (new) combination of old technologies. It's easier to sell them that way, plain and simple. A new name for a feature that's been part of a language from the very beginning is too much for me, though.
Have something to say about this post? Share your thoughts!
This post was published on Thursday 24th of March 2005. The previous entry was "What's in a name?". The next entry is "Checking dates using JavaScript".