Skip to content

Instantly share code, notes, and snippets.

@pwightman
Last active January 4, 2016 06:39
Show Gist options
  • Save pwightman/8583238 to your computer and use it in GitHub Desktop.
Save pwightman/8583238 to your computer and use it in GitHub Desktop.

Which do you prefer? (name key is object's unique identifier)

[
  {
    "name": "bob",
    "foo": "bar"
  },
  {
    "name": "alice",
    "foo": "baz"
  }
]
{
  "bob": { "foo": "bar" },
  "alice": { "foo": "bar" }
}
@armadsen
Copy link

I prefer the first style. It seems (slightly) easier to turn into Objective-C objects where even the unique identifier is really just going to be another property of the object.

@mdarby
Copy link

mdarby commented Jan 23, 2014

I prefer the bottom style. Easier to grok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment