12 ms·
> My issue with the go way of iterators is, you can’t chain them like you would in JavaScrip Because it’s not JavaScript, and that is a good thing.
by mbrumlow 2y ago
> My issue with the go way of iterators is, you can’t chain them like you would in JavaScrip
Because it’s not JavaScript, and that is a good thing.
- eweise 2y agoBut not because you can't easily chain functions. That's just a deficiency in the language design.
- mbrumlow 2y agoNo. It’s a feature. Chaining makes some of the worst unreadable code.
- Varriount 2y agoIt always bugs me when I see that pattern in JavaScript, because each `map`, etc. call is an array allocation. Yeah, yeah, I know that the VM's memory allocators are likely optimized for fast allocation, but that doesn't make the allocation completely free.