Re:Show HN: SWAPI – A Star Wars API
by erydo on Friday December 05, 2014 @10:51PM
(#8708285)
That could happen but in a lot of strictly typed languages it would be non-obvious and special effort to do so.
There's absolutely no justification to send ints when you have any reasonable chance of needing to change it to a string later. Besides, IDs in a public API fundamentally are not numbers. You don't add them, subtract them, multiply them, shift them, inspect any property of them besides equality, or anything. They're opaque tokens used to identify things with the server.
There's absolutely no justification to send ints when you have any reasonable chance of needing to change it to a string later. Besides, IDs in a public API fundamentally are not numbers. You don't add them, subtract them, multiply them, shift them, inspect any property of them besides equality, or anything. They're opaque tokens used to identify things with the server.