crafting (and) JavaScript

Inheritance, Polymorphism & Testing

From The Clean Code Talks this is a very good one by Misko Hevery where he is talking us out of using IFs, or at least trying to explain what IFs actually mean in code. And how we can better cater for those cases using polymorphism and how this also enables us to test better.

your object only has one inheritance hierarchy, which suggests that you should only have one responsibility

at 35:50 min