▶

Using Polymorphism to Replace Repeated Conditionals

Google TechTalks · Talk · 38 min · 2008 · YouTube title: "The Clean Code Talks -- Inheritance, Polymorphism, & Testing"
Why it's here

HN commenters recommend it as a thorough treatment of replacing conditionals with polymorphism and why flags and deep ifs can be code smells.

What it covers

Misko Hevery's Clean Code Talk shows how to use object-oriented techniques such as polymorphism to remove repeated if and switch statements. The result is code that is easier to test, understand and maintain.