I’ve seen that a new “range-over-func” experiment is available with Go 1.22. In this article, I took a closer look and evaluated the feature for myself.
I’ve seen that a new “range-over-func” experiment is available with Go 1.22. In this article, I took a closer look and evaluated the feature for myself.
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.
I think this https://github.com/golang/go/discussions/56413 is the discussion.
Also an interesting read from Russ Cox: https://research.swtch.com/coro
I’d like to add that in my perception you’re a little bit overreacting. I can’t say that I got the same impression that you apparently got from the first comment. To me it sounds as if it’s primarily about missing some depth and could use some more advanced examples - especially when compared to the post Russ Cox wrote 😅 no offense!
Maybe I’m a little tired. I’ve argued a lot about this on reddit as well and have become a bit frustrated with people telling me I’m missing things, without being able to actually provide any convincing real world examples. It’s not my goal to cause drama or offend anyone. Sorry, if I came across a little cranky.
Thanks for linking some resources! I’ll take a look and see if I can find some compelling arguments there.