News for hackers. Stuff that matters.
Re:You probably don’t need input type=“number” by baroffoos on Monday March 25, 2019 @12:57AM (#19480383)
Thats a good rule for dealing with messy real world systems like post codes and phone numbers but its still fine to use numbers in strictly defined non math systems. My database id column uses numbers and I have never had to do math on them other than ordering by id. The only potential issues I would look out for is things where leading zeros could be important and a database would probably drop.
Re:You probably don’t need input type=“number” by rickycook on Monday March 25, 2019 @01:49AM (#19480548)
you increment your database ID for each row... 9-10 is natural for numbers but doesn’t flow for strings. making the number into a string is pointless because it always starts it’s life as a number
Re:You probably don’t need input type=“number” by yen223 on Monday March 25, 2019 @03:14AM (#19480779)
What I find most of the time is that you only need IDs to be unique.

The fact that databases use auto-incrementing integers to ensure uniqueness is an implementation detail, and not a strictly necessary one (think UUIDs).

Re:You probably don’t need input type=“number” by ryanbrunner on Monday March 25, 2019 @08:30AM (#19481910)
Right, but I think the main point is if you're going to use auto-incrementation to provide values for your IDs, you might as well use numbers, since at that point you are doing math on them (one super simple operation of "+1", but math nonetheless.)
Re:You probably don’t need input type=“number” by dalore on Monday March 25, 2019 @10:55AM (#19482947)
If you use UUIDs you can have clients distributed around generate IDs for the db before they even save, no need for a +1 centralized id mechanism. That becomes a bottleneck.