Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
rcleveng
· 1y ago · 0 comments
If your language supports generators, this works a lot better than making copies of the entire dataset too.
Comments
[–]
akshayshah
1y ago
Sometimes, sure - but sometimes, passing around a fat wrapper around a DB cursor is worse, and the code would be better off paginating and materializing each page of data in memory. As usual, it depends.
[–]
KlayLay
1y ago
You don't need your programming language to implement generators for you. You can implement them yourself.