3 ms·
Isn't the lesson only that ids shouldn't be floats? If they were integers everything would be fine, but JS numbers aren't integers, even if they look like them
by justinpombrio 3y ago
Isn't the lesson only that ids shouldn't be floats? If they were integers everything would be fine, but JS numbers aren't integers, even if they look like them sometimes.
- skrebbel 3y agoNah, the lesson is broader than that, cause numbers as IDs have a whole bunch of problems and this is just one of them. Eg Twitter has incrementing number IDs and back when they had this whole ecosystem of 3rd party twitter apps (that they have since ruined), half the apps failed when the IDs became too large to fit into a 32-bit int. If it looks like a number, and it quacks like a number, sooner or later people are going to treat it like a number.
- aleph_minus_one 3y ago> If it looks like a number, and it quacks like a number, sooner or later people are going to treat it like a number. Which is perfectly fine; just don't treat it like an int32. :-)