3 ms·
In a statically typed language, it shouldn't be necessary to break type safety to implement basic abstractions. The only thing interface{} provides over void* i
by djur 12y ago
In a statically typed language, it shouldn't be necessary to break type safety to implement basic abstractions. The only thing interface{} provides over void* is safe typecasting.
- frou_dh 12y agoWell that's not to be sneezed at, even though it remains crude.
- tonyhb 12y agoIn other statically typed languages you don't break type safety to implement abstractions. In go, where interfaces are implemented by default and `interface{}` covers everything, you also don't need to. It's just a little bit (~6 lines) of code to add to guarantee it while they figure out a nice way to add generics.