this post was submitted on 10 Feb 2024
1 points (54.5% liked)
Golang
1645 readers
1 users here now
This is a community dedicated to the go programming language.
Useful Links:
Rules:
- Posts must be relevant to Go
- No NSFW content
- No hate speech, bigotry, etc
- Try to keep discussions on topic
- No spam of tools/companies/advertisements
- It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Article is missing a lot of keys points. With iterator you can chain them together to provide even higher level abstractions.
There are plenty of containers (new maps with different algorithms like a BtreeMap, linked lists, etc) that now with generics could also use a generic way of iterating over them.
There was a pre-proposal discussion that went into a lot of detail of what is possible that wasn’t intended the release notes. I highly suggest the writer of this article dig much deeper into more benefits of iterators than the two trivial options that were included in the experiment description.
Thanks for sharing your opinion with me!
What I'm hearing is basically "you don't understand the real benefits, so your not qualified to judge the proposal". I find this attitude quite harmful. If you think, I'm missing something important, please tell me about it. You will only convince me with arguments, not by patronizing me. Could you at least link the mentioned discussion?
To me, it seemed intended, that Go only has two first-level containers (slices and maps). It forces a certain amount of "uniformity" by giving other containers a disadvantage. Of course, in some scenarios you really need a different container and it will be more cumbersome to use, but it is by no means impossible without range-over-func.
No harm intended but if you are reaching a conclusion that such a feature is not needed without going into more detail than “harm” can go the other way as well.
Sorry I didn’t link the discussion as I was on my phone and no partonization was intended.