Comment

Comment by bokwoon

For modelling trees, I much prefer using a list of ancestors compared to the parent-child adjacency list because it doesn't require recursion to answer basic questions. I had thought about how I would model threaded comments in SQL some time ago and wrote down an example of what I mean:

https://gist.github.com/bokwoon95/4fd34a78e72b2935e78ec0f40e...

parent bokwoon 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton