3 ms·
No inheritance. I’ve personally come to view inheritance-based OO as somewhat of an antipattern in many cases, bloating and obscuring code for little benefit S
by stcredzero 12y ago
No inheritance. I’ve personally come to view inheritance-based OO as somewhat of an antipattern in many cases, bloating and obscuring code for little benefit
So everywhere you would use inheritance, you use composition instead? The stuff you'd have stuck in the superclass, you stick somewhere else and stick in your struct?
- autarch 12y ago> So everywhere you would use inheritance, you use composition instead? The stuff you'd have stuck in the superclass, you stick somewhere else and stick in your struct? No, Go provides interfaces (aka traits or roles), which you can use to share composable functions (aka methods).
- stcredzero 12y agoNo, Go provides interfaces (aka traits or roles), which you can use to share composable functions (aka methods). I wasn't talking about creating conventions/apis/facades, rather about how one reuses code.