News for hackers. Stuff that matters.
Re:Go makes it easier to write correct, clear and efficient ... by eropple on Friday May 10, 2019 @09:45AM (#19877606)
> The overhead of interface{} isn't as high as people sometimes think.

The cognitive overhead certainly is. Computers exist to help us do things faster and with fewer mistakes. This is a prime example of using a computer to help us make more mistakes, worse.

Re:Go makes it easier to write correct, clear and efficient ... by foldr on Friday May 10, 2019 @10:56AM (#19878356)
Yes, using interface{} introduces a small chance of runtime type errors. I have not heard of any Go projects finding this to be much of a problem in practice. You can also use the type-safe wrapper pattern to avoid this if it's likely to be a problem.

There is no doubt that not having generics makes some code worse than it would be with generics. But I think the problem is often overstated.