r/javascript • u/mpjme • Sep 21 '15
Composition over Inheritance (9 min video)
https://medium.com/humans-create-software/composition-over-inheritance-cb6f88070205
17
Upvotes
1
u/benihana react, node Sep 22 '15
1
0
Sep 22 '15
[deleted]
2
u/mpjme Sep 22 '15
Here's a response from medium: https://twitter.com/mpjme/status/646308765206188032
1
u/TweetsInCommentsBot Sep 22 '15
@Medium hey, is this expected behavior? https://www.np.reddit.com/r/javascript/comments/3ltwk0/composition_over_inheritance_9_min_video/cva2ogw
This message was created by a bot
4
1
4
u/MoTTs_ Sep 25 '15
As I watched your video, I thought, "Wait... that's not composition. That's multiple inheritance." Then I looked at the comments of (a different) reddit thread, and the top voted comment said exactly the same thing.
EDIT: For example, in Python, which supports multiple inheritance, we can write: