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

Yeah but still you have to admit, there's quite a lot more friction and ambiguity in that approach. Do I represent a map as

    [
      ["key", "value"],
      ["otherKey", "otherValue"]
    ]  
  
or

    [
      {"key": "key", "value": "value"},
      {"key": "otherKey", "value":"otherValue"}
    ]  
or something else? And how can I distinguish between values which just happen to look like maps but are actually not maps? And what if the service I'm talking to does it differently? What if I'm comparing or sorting two JSON values, don't I have to modify the equality/hashcode/ordering logic now to interpret

    [
      ["key", "value"],
      ["otherKey", "otherValue"]
    ] 
and

    [
      ["otherKey", "otherValue"],
      ["key", "value"]
    ] 
as being equal and implement a new hashcode/ordering which treats them as equal?

Quite a lot easier when this is just native to the format.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: