Composition Over Inheritance
summary
Go favors composition over inheritance and demonstrates this by building a concrete gopher struct, an interface type with sayHello/get/fall methods, and composing behaviors via type embedding. The talk shows that Go has structs not classes, methods attach to types, exported names start uppercase, and there are no getters or setters enforced. Code examples compile and run, illustrating fewer brittle hierarchies and easier behavior reuse than classical inheritance.
AI-written summary · about
chapters (5)
- 0:00Start
- 1:19Composition over Inheritance or the Composite Reuse Principle
- 1:47The Benefits of Composition over Inheritance
- 2:43User-Defined Types with Structs
- 4:38Conclusion
related talks
33mIs Go Object-Oriented? A Case of Public Opinion
33mClean Up Your GOOOP: How to Break OOP Muscle Memory
33mClean Up Your GOOOP: How to Break OOP Muscle Memory
01h 02mKeeping it Simple With Go
23mFrom OOP to Go
04mGo is a great OO language
52mGo Go Java Developer
17mFrom Java to Go: I Have a Hammer and See Nails Everywhere
