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 552380
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[8]: My thoughts on Go
by lucas_maximus on Wed 13th Feb 2013 21:19 UTC in reply to "RE[7]: My thoughts on Go"
lucas_maximus
Member since:
2009-08-18

The whole point of knowing whether that something implements an interface is that it is easy to know whether it actually has certain properties and methods.

If this is all implied than I think it defeats the point of them.

Edited 2013-02-13 21:26 UTC

Reply Parent Score: 2

RE[9]: My thoughts on Go
by satsujinka on Wed 13th Feb 2013 22:33 in reply to "RE[8]: My thoughts on Go"
satsujinka Member since:
2010-03-11

If you use interfaces as a primary means of tagging your objects then, yes you can't do that in Go.

However, interfaces aren't just a means of saying this object can do this, that, and the other. The methods of an object do that just fine; there's no need to be redundant. Instead, Go uses interfaces as a contract. If I need a Reader then I'm going to be using a Read method. Which object this is doesn't matter.

I commented on this earlier, but Go's interfaces are backwards in comparison to most others. It's not the object that implements an interface, but the interface that defines an object.

Reply Parent Score: 2

RE[10]: My thoughts on Go
by lucas_maximus on Wed 13th Feb 2013 23:17 in reply to "RE[9]: My thoughts on Go"
lucas_maximus Member since:
2009-08-18

If you use interfaces as a primary means of tagging your objects then, yes you can't do that in Go.


However, interfaces aren't just a means of saying this object can do this, that, and the other. The methods of an object do that just fine; there's no need to be redundant. Instead, Go uses interfaces as a contract. If I need a Reader then I'm going to be using a Read method. Which object this is doesn't matter.


Except that contract isn't explicitly stated. I don't know that by looking at the code. I don't think that is helpful when it comes to code readability. I am big on that.

Reply Parent Score: 2