23 ms·
> But I don't see how that's different from explicit interfaces; in both cases the intent is only implied by the name. Go's approach is theoretically more erro
by shasta 12y ago
> But I don't see how that's different from explicit interfaces; in both cases the intent is only implied by the name.
Go's approach is theoretically more error prone. It relies on names matching in a way that can happen by coincidence. The important part of explicit interfaces here is referencing a common declaration site, that could e.g. give informal requirements in the form of comments. I doubt Go's approach is particularly error prone in practice, though.