• einkorn
    link
    fedilink
    arrow-up
    3
    arrow-down
    2
    ·
    5 hours ago

    I can’t find it right now, but there is some explanation in “Clean Code” why switches shouldn’t be used all over the place.

    • djnattyp@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      4 hours ago

      Google for “replace conditional with polymorphism”.

      Just checked and it is in “Clean Code” - Chaper 17; Section G23 “Prefer Polymorphism to if/else or switch/case”.