2 ms·
You certainly can implement Go-like interfaces alongside generics. There's nothing inconsistent about them.
by pcwalton 11y ago
You certainly can implement Go-like interfaces alongside generics. There's nothing inconsistent about them.
- arihant 11y agoYes, but the typical consequences that arise out of that do not fit with design goals of Go. Just off the top of my head - boxed types, for example lead to Java-style inheritance patterns. This sits awfully with composability and readability of Go code. You read Go code like a tree. You read Java code as multiply linked list.