News for hackers. Stuff that matters.
Re:Auto increment is a terrible idea by ealexhudson on Thursday November 30, 2017 @08:55AM (#15815686)
There are definitely better reasons that those given in the article. My two favourite are:

* it prevents tables having any obvious "natural" ordering. I still see developers writing queries, relying on the order of the data but not specifying ORDER BY. The flip-side to this is that sometimes they discover they need an ordering that they don't have - e.g. date record created - which is also great practice. * it removes pre-conceptions that developers might have about auto increments. I've seen auto-increment used for invoice numbers more times than I care to remember: a task it's entirely unsuited for. If a developer needs a monotonic ID, but don't have an AI field, they have to think longer and harder about the type of number they need, and what the rules about transactions rolling back need to be. Again, better correctness is the result (at a cost of more time / thought).

Auto-increment isn't a terrible idea at all, and there are good UI reasons to not like it, but there are also decent reasons to use something else.

Re:Auto increment is a terrible idea by wolfgang42 on Thursday November 30, 2017 @11:38AM (#15817095)
What makes autoincrement unsuited for invoice numbers, and what would you recommend instead? (I'll admit to being one of those developers who hasn't thought long and hard about this, but I can't off the top of my head come up with any reasons why they would be a problem.)