News for hackers. Stuff that matters.
Re:Go by Example by hdevalence on Friday January 17, 2014 @09:52AM (#7076009)
What? I'm talking about stuff like this, copied from the documentation:

    func (a ByAge) Len() int           { return len(a) }
    func (a ByAge) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
    func (a ByAge) Less(i, j int) bool { return a[i].Age < a[j].Age }
How does forcing me to type out (or copy-paste) an implementation of Swap increase safety? If anything, it just makes the code more error-prone.

And not having generics means that (as far as I can tell) people end up using a lot of `interface{}`. How does that increase safety?

More importantly, why would I want to use a language whose solution to the problem of "dealing with generic data" essentially boils down to "use a void*"?

There are no comments on this comment yet.