OT: Why would you ever use numbers instead of strings for ids?
David Bovill
david.bovill at gmail.com
Thu Sep 19 06:46:57 EDT 2013
I've been looking at the Twitter API v1.1, and there is a lot about the
tweet ids being 64bit integers and that because JavaScript (and LiveCode)
don't support these there is also a "string" version - of the number.
So my "dumb" question of the day is why would you ever want to use a number
rather than a string as an id? My personal uniformed answer has always been
along the lines:
1. No good reason - historical
2. ID lookups tend to be faster
3. Some scenarios allow you to derive meaning from incremental increases
in the number - ie it is the next in a series
Naturally in Livecode the difference between numbers and strings is
deliberately and unusually blurred. Still in general it always seemed to me
that reasons 2 & 3 were insufficient. Can someone explain why on earth the
Twitter API does not just use screen names ( a unique lower case string of
15 chars without spaces) - what is the advantage of also having a 16
integer number?
More information about the use-livecode
mailing list