Linked by Thom Holwerda on Mon 11th Feb 2013 22:59 UTC
General Development "I feel like writing about the Go programming language (or 'Golang') today, so instead today's topic is computer stuff. For the record, the language I've programmed the most in has been Python, so that’s the perspective I'm analyzing it from." Some good and bad things about Go.
Permalink for comment 552486
To read all comments associated with this story, please click here.
RE[15]: My thoughts on Go
by satsujinka on Thu 14th Feb 2013 20:08 UTC in reply to "RE[14]: My thoughts on Go"
satsujinka
Member since:
2010-03-11

As I've said "up-teenth times" it is still crystal clear.

Your example makes sense in Go. The issue that you're missing is that the only time it matters if something does implement an interface is when you're using an interface as a parameter. In which case your example is more literally:

"Any valid object for this parameter must have the methods defined by this interface"

And again, if it doesn't the compiler will "kick your ass straight away".

In my opinion, you're focusing way too much on the definition of an object and no where near enough on actually using the object. So I'll repeat:

An object has methods defined with it, these methods are sufficient to tell you what the object can do. Interfaces are a separate concept designed to provide a contract for parameters. Thus mixing the interface with the object is redundant.

Go as a language tries to avoid redundancy. Maybe this hurts readability in your eyes, but in practice there's no difference and the "issue" you seem to have never comes up.

Reply Parent Score: 2