News for hackers. Stuff that matters.
Re:Removing Array Duplicates by lqet on Friday April 12, 2019 @05:54AM (#19643460)
This is a bit like saying that English is a language superior to Danish, because there are better books out there in English.

I don't think this has anything to do with the language, it just happens that C++ ships with a much bigger standard library than Go.

Re:Removing Array Duplicates by saagarjha on Friday April 12, 2019 @07:05AM (#19643724)
Keep in mind that I’m not saying that C++ is a better language than Go here: I’d need a lot more evidence than an array deduplication routine to prove this. I’m just saying that Go is ill-suited for this particular task as compared to C++, and the author is struggling with this as they go through with implementing their algorithm; this leads them to settle on a clumsy and inefficient “solution” because there isn’t really a good alternative in the confines of the language that they chose. (FWIW, C++ does have a good standard library for implementing algorithms but this doesn’t really come into play here, since we’re not doing anything advanced. Any language with a set and filter would do the job. And for the record, I do think that C++ is a better language than Go, but I’m not going to argue it here because I don’t know the latter well enough to be confident in my viewpoint and don’t have enough space here to discuss it here if I did.)
Re:Removing Array Duplicates by Nimelrian on Friday April 12, 2019 @06:01AM (#19643494)
It's much easier to implement in Javascript, too, even though JS has a much smaller standard library. The main problem is Go's lack of generics.
Re:Removing Array Duplicates by bryanrasmussen on Friday April 12, 2019 @06:47AM (#19643657)
indeed, currently the standard library of JS is incredibly small.
Re:Removing Array Duplicates by icebraining on Friday April 12, 2019 @06:51AM (#19643682)
It does have to do with the language. Writing a generic Set type is trivial in many languages, yet hard in Go.
Re:Removing Array Duplicates by johannkokos on Friday April 12, 2019 @06:20AM (#19643553)
> it just happens that C++ ships with a much bigger standard library than Go.

I thought go had much bigger standard library. Go has archive, compression, crypto, database, encoding, hash, html, and net etc.