3 ms·
Go's structs with associated methods and property/method promotion aren't that different from classic OOP. Too much is made of the differences, I think. You can
by cutler 6y ago
Go's structs with associated methods and property/method promotion aren't that different from classic OOP. Too much is made of the differences, I think. You can recreate most basic OOP code in Go .... if you really must.
- grey-area 6y agoI do think it’s very different; types are not classes and interfaces are not like interfaces in java, obj-c for example, being defined at point of use. If you try to recreate inheritance in Go it will be frustrating and not very useful. The shape of the code ends up very different and embedding is not used even half as much as inheritance (which is the default position in most other oop languages). That has profound impacts.
- pjmlp 6y agoIt is basically Component Based Programming, started with Objective-C protocols, Smalltalk categories, Java/.NET interfaces, COM ABI. inheritance is just like in COM via delegation and struct embedding.