4 ms·
> Scaling a tree structured view is difficult as hell. It's not that hard with so few comments, it's just a matter of UX philosophy. At reddit we solved this
by jedberg 5y ago
> Scaling a tree structured view is difficult as hell.
It's not that hard with so few comments, it's just a matter of UX philosophy. At reddit we solved this with the "load more comments" AJAX request and "continue this thread". "Continue" only happens when a tree gets too deep, and then is just sets the current comment as the top of the tree and recalculates.
"load more" happens after the comment limit was reached, but since it's AJAX it doesn't really take away from the viewing experience (and I think in new reddit it just auto loads when you scroll to it).
Here's the reddit code if you want to see it: https://github.com/reddit-archive/reddit/blob/master/r2/r2/lib/comment_tree.py https://github.com/reddit-archive/reddit/blob/master/r2/r2/l...
The main issue for HN is that it's static so when a node gets a lot of children, it breaks a lot of their assumptions and makes for very large blobs of HTML to display the tree.
Honestly it's probably a worthwhile tradeoff -- for the most part the threads here don't get so deep that it's a problem, and in exchange we get a super snappy website most of the time.
- fatih-erikli 5y agoThank you! I will look at that.