2 ms·
I've not done anything too interesting with Rust, but I've had sort of mixed opinions of Generators. They can obviously be very cool, but it also does kind of f
by tombert 3y ago
I've not done anything too interesting with Rust, but I've had sort of mixed opinions of Generators. They can obviously be very cool, but it also does kind of feel annoying how much my code can just jump around in ways that, in my opinion, are a bit difficult to predict.
That said, when used right they can do a lot to decouple logic, so maybe this is just some of my old bad habits being throughly unwilling to die.
- yencabulator 3y agoIt's not really any different from an iterator with some maps and filters slapped on top of it. Or how generators work in e.g. Python. Async makes it worse. I'm currently debugging an infinite loop where apparently it's collecting an in-memory data source into a single Vec, but keeps forever entering&exiting a future with no progress...