News for hackers. Stuff that matters.
Re:Auto increment is a terrible idea by gjem97 on Thursday November 30, 2017 @08:45AM (#15815617)
Does anyone use ULIDs [1] instead of UUIDs for stuff like this? I like that they're sortable.

[1] https://github.com/alizain/ulid

Re:Auto increment is a terrible idea by WorldMaker on Thursday November 30, 2017 @12:39PM (#15817652)
I've been using ULIDs heavily in my projects lately. The lexicographic sort was something I was particularly looking for, because CouchDB _id indexes are lexicographic, meaning I more often than not can just use the main index and the order it returns the items. Given these projects are "offline first" apps, a stable sort and low probability of collisions were key needs.
Re:Auto increment is a terrible idea by joekrill on Thursday November 30, 2017 @09:00AM (#15815711)
What use is sorting a randomly generated value? I guess you're technically sorting on creation time?
Re:Auto increment is a terrible idea by dozzie on Thursday November 30, 2017 @09:23AM (#15815859)
> What use is sorting a randomly generated value?

In general, order determinism. The elements in the table or list don't shuffle on every refresh.

Re:Auto increment is a terrible idea by gjem97 on Thursday November 30, 2017 @09:19AM (#15815828)
Yes, the prefix is the timestamp.