3 ms·
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 wri
by stouset 3y ago
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.
- alex_lav 3y agoI used to really like Go. Now that I don't work with it, I find that the further I go on without it, and with using other tools, the less and less I'd want to go back.
- yencabulator 3y agoYou'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.
- stouset 3y agoThis 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.
- philosopher1234 3y agoSo you say, with no actual reference. Maybe what you refer to happened in your head, and not in the real world.
- alex_lav 3y ago1. Generics 2. Clear Are the two already covered not enough?
- philosopher1234 3y agoI 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.
- alex_lav 3y agohttps://news.ycombinator.com/item?id=23033183 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!
- philosopher1234 3y agoFrom 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.
- alex_lav 3y ago> I think an unbiased, responsible observer would have to conclude similarly to me. Unsurprising conclusion. Enjoy the day!
- alex_lav 3y agoCan 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.