4 ms·
Why not: { id: 35, name: "Kennedy, John F.", predecessor: { id: 34, name: "Eisenhower, Dwight D.", href: "/presidents/34" }, successor: {
by zachrose 14y ago
Why not:
{
id: 35,
name: "Kennedy, John F.",
predecessor: {
id: 34,
name: "Eisenhower, Dwight D.",
href: "/presidents/34"
},
successor: {
id: 36,
name: "Johnson, Lyndon B.",
href: "/presidents/36"
}
}
- justincormack 14y agokill the ids, URLs are ids having extra ones just makes life harder. You could have an ordinal for presidents of course.
- icebraining 14y agoBesides killing ids, use full URIs, not just the path. That enables you to replace the links to other domains, possibly to a third-party. Just like we often link to Wikipedia on our posts, you could decide tomorrow that your service should link to dbpedia.org or Freebase instead.