plebbit / plebbit-js

A Javascript API to build applications using plebbit
GNU General Public License v2.0
41 stars 7 forks source link

implement "best" sort for replies #44

Open estebanabaroa opened 3 weeks ago

estebanabaroa commented 3 weeks ago

it seems like it was added to reddit in 2009, so it probably contributed to its success and could be important to implement at some point.

it should probably be included in comment.replies.pages.best

I converted the implementation to js in the hooks https://github.com/plebbit/plebbit-react-hooks/blob/e5b30dcd62f1f355bc3ce52555e7f71ea4cae06b/src/stores/feeds/feed-sorter.ts#L98

there's an SQL example in this blog post https://www.evanmiller.org/how-not-to-sort-by-average-rating.html

Rinse12 commented 1 week ago

Is there a reason why we shouldn't implement it in posts as well?

estebanabaroa commented 1 week ago

Is there a reason why we shouldn't implement it in posts as well?

I think the "best" feed sort type only came out in reddit much later, like after 2015+, so it only came out after reddit went to crap. Whereas the "best" comment sort type came out in 2009 or something, so it might have played a role in reddit success, so we probably do want it imo.

We also don't know what the "best" feed algo is, it doesn't use this "confidence" algo because the confidence algo isn't time based at all, it's only vote based, so confidence is more like a "top" sort, but slightly different. And I dont think having a second "top" sort would be useful, the top sort isn't used that often anyway, so having a second one would be kind of useless, also we couldnt even name it "best" because it would be confusing, people would see really old posts since it's not time based, it wouldnt be the same as the reddit "best" post sort algo which is unknown.

Also we want to minimize the amount of sort types we offer, cause it creates more cids to announce. We should probably remove all controversial sorts actually, it adds a lot of cids, and few people use it, only reddit has it I think.

for feed we probably only want

hot new active topHour topDay topWeek topMonth topYear topAll

and top pages for topMonth, topYear amd topAll should be pretty large and rarely updated to lower the amount of cids to announce

for replies we probably only want

best new newFlat (telegram style flat conversations, where you see newer first, and scroll to older) old oldFlat (4chan style flat replies)

if all replies fit in 1 page, don't create any page cids at all to reduce the amount of cids to announce, just put then all in post.replies.pages.best and the other page sorts can be created client side. almost all posts never reach more than 1 replies page, so this will lower the amount of cids by a lot

also pages 2+ should be pretty large to lower the amount of cids to announce, and for new, newFlat, the last pages rarely need to change, so don't update them a lot

so imo we should remove all controversial sorts, they are cool but rarely used, and waste too many cids to announce, and we shouldn't have both top and best, it should be either or, since they are both pretty similar