hackertube.io

"The Clean Code Talks -- Inheritance, Polymorphism, & Testing"

Google TechTalks · talk · Watch on YouTube

What it is

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.

Why Hacker News recommends it

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

  • 3 people recommended it
  • 3 different months
  • 0 strong recommendations
  • first 2009, last 2023

What HN commenters said

  1. “which is more comprehensive than the posted article.”

    More comprehensive treatment of replacing conditionals with polymorphism.

    derwiki, 2009-09 · Recommendation · in “Using Polymorphism instead of conditionals when programming”

  2. “I believe the google clean code talks gives a far better arguement than I ever could.”

    Better argument for OO principles than the blog.

    VBprogrammer, 2010-06 · Recommendation · in “Criminal Overengineering”

  3. “This talk gives a great overview of why boolean flags (rather, if-statements) can be a code smell”

    Why boolean flags and deep if-statements are a code smell.

    Mr_P, 2022-05 · Recommendation · in “Flags Are a Code Smell (2014)”

Excerpts from Hacker News comments, linked to the originals. Summaries and labels were written by a language model from those comments.

Topics: clean code, polymorphism, object-oriented design, testing, refactoring

Also recommended by the same people