3 ms·
The book "Design Patterns: Elements of Reusable Object-Oriented Software" has an initial chapter that provides one of the most concise introductions to OO I've
by bborud 4y ago
The book "Design Patterns: Elements of Reusable Object-Oriented Software" has an initial chapter that provides one of the most concise introductions to OO I've read. Its main focus is on polymorphism and it provides some easy to understand examples.
In fact, if you think of Go as an OO language (which I guess many won't), it has all the things you actually care about from OO. It doesn't have inheritance and you don't explicitly declare that a type implements some interface (). Since there is no inheritance of implementation you are forced to use composition, which is what people tend to end up recommending after a few years of fighting with OO code that has been written by people in love with a Linnean hierarchies and complex approaches to DRY.
() There are tricks to accomplish this, for instance creating a New() function that returns an interface type, which will make the compiler ensure you implement the interface).