Re:In praise of Go or "Why I moved from Python and C++ to Go"
by jamesaguilar on Tuesday November 16, 2010 @11:05PM
(#1912860)
Also, an "interface" is more of an enforced duck type annotation than an interface or ABC in Java or C++ terms respectively.
[ Parent
| on HN ]
Re:In praise of Go or "Why I moved from Python and C++ to Go"
by aaronblohowiak on Tuesday November 16, 2010 @11:18PM
(#1912890)
IIRC, the duck-type mode uses implicit interface creation but you can force an explicit interface if you want (please correct me if i am wrong.)
Re:In praise of Go or "Why I moved from Python and C++ to Go"
by BarkMore on Tuesday November 16, 2010 @11:25PM
(#1912907)
Interfaces are explicitly defined in Go as they are in Java. The difference is that you do not declare the interfaces implemented by a type. If a type has methods that match an interface, then the type implicitly implements the interface.
Re:In praise of Go or "Why I moved from Python and C++ to Go"
by aaronblohowiak on Wednesday November 17, 2010 @12:31AM
(#1913040)
Oooooh, that makes sense. Thanks for the clarification.