“Let’s have each user take an individual snapshot of the database to scroll over until they refresh like in ZFS” ok buddy
Tell me you’ve dabbled in homelab stuff without telling me you’ve never designed a high traffic web backend
Comment on Why does Lemmy (and reddit) show posts from previous page on next page?
jet@hackertalks.com 1 year ago
Lazy programming.
The naive way to do pagination is to say show me items x through y. But obviously if the back end is dynamic, x through y could change. So the better way to program pagination is to say show me items above item n, too item n plus x. Then you can have dynamic pagination based on the last comment, you saw.
Another way to do this is have your session look at a static snapshot of the dynamic database, until you refresh the page or go back to the top. This is possible with a lot of different databases, kind of like how ZFS can give you snapshots of root at any time.
“Let’s have each user take an individual snapshot of the database to scroll over until they refresh like in ZFS” ok buddy
Tell me you’ve dabbled in homelab stuff without telling me you’ve never designed a high traffic web backend
Sir, you hadly know me! Disagree fine, but don’t assume my pedigree.
Why do you have to be so condescending from the get-go? Just explaining why it wouldn’t work would have been fine.
To be fair it’s in response to a guy that started of by calling the programmers lazy.
That explains, but doesn’t excuse.
devious@lemmy.world 1 year ago
I don’t know if it is lazy as much as it is a design choice - remember at one point Lemmy actually auto updated (which meant posts were pushed down while you were browsing) and it was an intentional design.
github.com/LemmyNet/lemmy/issues/2841#issuecommen…
jet@hackertalks.com 1 year ago
It’s a valid design choice. But it is to keep the programming simple. One might characterize that kind of choice as lazy. Especially in terms of user interface. But I’m not beating up on Lemmy. I’m just explaining to the original poster the trade-offs that people make.
Swedneck@discuss.tchncs.de 1 year ago
one man’s lazy is another man’s efficient and pragmatic
Thehalfjew@lemmy.world 1 year ago
It’s not necessarily lazy. If I want to go back to a particular post I saw on page 1 when I’m on page 2, but it was knocked off the front page, how would I find it? It’s no longer on page 1, so back would miss it. I’d have to go to 1 and then back again to 2 to find a post that moved.
It gets even more complicated when the algorithm also changes post order.
Sometimes simple with minor inconvenience is the best option.
hedgehog@ttrpg.network 1 year ago
In an endlessly scrolling implementation, you’d just scroll up.
Without endless scrolling, it could behave as follows: