3 ms·
I've used plenty of languages with iterators but have also never really missed them very much in Go. So I think this is a flawed analysis. The proposed Go itera
by foldr 2y ago
I've used plenty of languages with iterators but have also never really missed them very much in Go. So I think this is a flawed analysis. The proposed Go iterators are just syntax sugar over some existing code patterns. They'll be nice to have but one can very easily do without them.
By way of analogy, consider that almost any language is missing lots of features present in some other languages. For example, Go does not have inheritance. If I do not miss that feature while using it, that does not necessarily mean that I'm a Blub victim.
- klabb3 2y agoGP here. Yeah I don't think I’m blubby in that sense. I used to work daily in Rust, including with custom collection types. And lots of other language experience with iterators. Go has maps and slices, and slices fit 99% of my use cases. You can index, reslice, concat, append, sort, sort by, clone, and yes, iterate with range (although the range syntax itself is merely a small convenience). As for the chaining, yes I do miss filter and map but is again totally doable with vanilla slices (they just haven’t added those methods to the slices package).