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.
Thread beginning with comment 552486
To view parent comment, click here.
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

RE[16]: My thoughts on Go
by lucas_maximus on Thu 14th Feb 2013 20:47 in reply to "RE[15]: My thoughts on Go"
lucas_maximus Member since:
2009-08-18

You keep on missing the point.

There is a keyword in Java that say

public MyClass implents IMyInterface.

That keyword is unambiguous. I can read the line and say to myself ... If MyClass does implement the interface correctly it won't compile.

It called readability and you keep on ignoring the fact that I keep on saying the say thing and you address it with some bullshit work around. Which I don't think is acceptable.

Reply Parent Score: 2

RE[17]: My thoughts on Go
by satsujinka on Thu 14th Feb 2013 20:58 in reply to "RE[16]: My thoughts on Go"
satsujinka Member since:
2010-03-11

And what I keep saying is that "implements" doesn't do anything for readability.

The only thing "implements" does is force an object to have a certain signature. This is discussed in a different sub-thread in which the conclusion was:

Explicitly listing interfaces gives you compile time guarantees of what methods will exist, but if an object has the necessary signature for a different, non-listed interface then you don't get to use the object for that interface (even though the object would work.)

Implicitly implementing interfaces has the reverse features. You lose compile time guarantees of what methods are available, but you get to use the object anywhere it might make sense to.

Reply Parent Score: 2