With a nod to Chris's excellent presentation, this may be an example of Go 
breaking its own orthogonality rules for the sake of being more consistent (the 
rule of least surprise)

There is a strong overlap between an interface with a single method and a 
function value, Tomás Senart spoke about this at last year's Gophercon, but as 
a function value cannot easily have two behaviours there is clearly a 
requirement for an interface with two or more methods (although SRP would tend 
to drive your design in the other direction, sometimes this is necessary) so an 
arbitrary restriction that an interface have more than one method would be 
surprising.

I think there is a strong parallel between this discussion and the occasional 
flair up of the "why does Go need new?" debate. The answer in both cases is 
while sometimes features appear to overlap in the simple case, they are 
actually independent. A small concession for consistency over orthogonality. 

Dave

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to