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.

source
Sort:hotnewtop