Hacker News new | past | comments | ask | show | jobs | submit login

> which is thrown away for some reason (probably parsing convenience).

It's got nothing to do with parsing. The json comes from JavaScript syntax, where objects represent unordered mapping. Json naturally does the same.

If you want expressive power for reading, json is very poor in comparison to pretty much everything else. Just use it for simple serialisation.




Granted, it came from there, but that was back in the days of map=eval(json) and they're gone. There is nothing in json the format (as opposed to json the language construct) to impose the unordered behavior.(Or, for that matters, the 'no comments' bit).


> There is nothing in json the format [..] to impose the unordered behavior

That's not true. The spec at http://www.json.org/ says "An object is an unordered set of name/value pairs".


Yes, that's in the specs. But what I meant is that there is nothing intrinsic to the format demanding unordered behavior.




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

Search: