|
|
|
|
|
by marcosdumay
3454 days ago
|
|
I'm referring to a pattern on OO languages where you specify an interface using a superclass¹, with hooks that you can specialize on subclasses, reusing most of the code on the superclass and keeping the code around it generic. Go interfaces have the part about keeping the code around it generic, but I don't think it gets the easy reuse of code by just writing the hooks. (But I can easily be wrong here - I'm not a proficient Go programmer.) In that, it looks very like Java's interfaces (the literal Interface thing). 1 - In Java you would not use a literal Interface for that, since you can't provide default code for the subclasses to extend. |
|