4 ms·
I regularly change 3 to 2 in /new/345689 links when bored with today’s content. Using ids makes logic to trac prev/next/page number incredibly complex and gene
by wruza 3y ago
I regularly change 3 to 2 in /new/345689 links when bored with today’s content.
Using ids makes logic to trac prev/next/page number incredibly complex and generally you don't need it.
When it’s a public site, users may post so fast that this “next” can show some previous page. Paging via ids is a must there.
- marcosdumay 3y ago> “next” can show some previous page That is usually a non-issue. The cost in DB operations is usually much more relevant than it. When people do actually care about fully enumeration and unicity of the items they they are querying, "pagination" itself tends to be a too messy concept.
- wruza 3y agoThe cost in DB operations is usually much more relevant than it. As a result, a user (all of them) hits “next” again until a page looks like containing new posts. It’s multiple requests wasted. Anyway, what exactly becomes messy?
- marcosdumay 3y agoWhat a "page" means when enough things appear between them that they push stuff a page away? Are those things reordered? Do people expect to see the new things before they get to the old? A "page" is a very ill-defined thing that can only exist if your stuff is mostly static. Queries are very different on dynamic content.
- wruza 3y agoYou’re overthinking (overquestioning) it. When a user hits “next”, they want to see next N posts from where they at, in order they chosen before, that’s it. Since there’s no evidence of a mess still, I believe you’re projecting it from an overthought side that isn’t real.