Re:Go 1.21
by yencabulator on Wednesday June 21, 2023 @10:44PM
(#36427430)
No, it's because a use case was discovered that the for loop approach can't handle: NaN keys.
I would argue Go's inability to manage NaN keys is irrelevant to the desire for "clear", in that I would argue that the NaN keys issue should be fixed _regardless_ of clear.
In my experience, that's exactly how this plays out every single time.
Dev: Can we have a function to clear a map?
Go: No, it's easy enough to write the 5 lines of code to just do it yourself every time.
Dev: Okay, I don't see why I should have to write those 5 lines every time but fine. Isn't looping over everything going to be slower than just… having a function that can empty the internals?
Go: We've implemented a compiler optimization to detect this and rewrite it to the faster code it would have been if it we were to implement it.
Dev: Isn't that… way harder than just writing the method? Anyway, I noticed this solution doesn't actually always work because of this edge case.
Go: Just handle the edge case every time then.
Dev: That's the point. I can't.
And around and around we go.
Re:Go 1.21
by yencabulator on Thursday June 22, 2023 @03:13PM
(#36437218)
You're distorting the real story to fit your bias. Once the NaNn edge case was discovered, work to deal with that edge case was started.
This isn't remotely close to the first or even the tenth time I've seen this exact pattern play out. Finally there's some straw that forces the golang team to backpedal on a dogmatic position, but along the way there's dozens of comical defenses of the current state of things.
Re:Go 1.21
by philosopher1234 on Friday June 23, 2023 @12:41AM
(#36442862)
So you say, with no actual reference. Maybe what you refer to happened in your head, and not in the real world.
1. Generics
2. Clear
Are the two already covered not enough?
Re:Go 1.21
by philosopher1234 on Sunday June 25, 2023 @03:03AM
(#36465686)
I would like to see some content from the go team on generics or clear that fits your claim. Yes, there are many in the community who speak the way you suggest, but you don’t seem to know much about the Go teams pov.
https://news.ycombinator.com/item?id=23033183
A pretty apt write up.
But I accept there’s probably not an amount of evidence to change your belief on Go’s dogmatism. And that’s okay! You like a language. That’s great!
Re:Go 1.21
by philosopher1234 on Monday June 26, 2023 @02:18PM
(#36483564)
From what I can tell the issue here is that Rob Pike thinks the label "generics" is inaccurate? Seems like a far cry from what you have accused them of. I think theres not only a lack of evidence to convince me, I think your claim is just straight up unsubstantiated. I think an unbiased, responsible observer would have to conclude similarly to me.
> I think an unbiased, responsible observer would have to conclude similarly to me.
Unsurprising conclusion. Enjoy the day!
Can you link to any unit of work that solves this edge case? Because all I can find are bugs and issues created 2015/2016/2017 that were closed and unresolved.
Slowly walking back dogmatic positions is just how the Go team works.
I say this as a person that wrote Go full time for a handful of years.