2 ms·
There is another downside, and that is when interfaces are used to tag semantics. Say that I have classes that computes metric space distances. I could make an
by danieldk 14y ago
There is another downside, and that is when interfaces are used to tag semantics. Say that I have classes that computes metric space distances. I could make an interface MetricSpace using a Distance method. However, in Go, every struct for which the Distance method is implemented with the same signature will implement the MetricSpace interface. In other languages with interfaces, only the types that are explicitly marked as implementing that interface will implement it.