Talk: Aly Sivji - If Statements are a Code Smell

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025

Комментарии • 10

  • @roytrudell6454
    @roytrudell6454 4 года назад +3

    I really enjoyed this talk! Great reminder on how OOP in python can sometimes make your code simpler and easier to follow. (readability counts!)

  • @charlielu05
    @charlielu05 4 года назад +4

    Great talk! inspired me to refactor my conditional code using polymorphism

  • @alenucci22
    @alenucci22 3 года назад +1

    Great talk, this "switch" situation is very frequent indeed and this pattern elegantly solves the given case or similar ones. I'd just say that ABCs and abstract methods may be a better solution then raising NotImplementedError in base class's method to be sure the derived class has been implemented correctly

  • @rexcorr
    @rexcorr 4 года назад +3

    Congratz, great talk. I'm in the step to read these books that you mentioned tô improve my code.

  • @paragkale4858
    @paragkale4858 4 года назад

    Great presentations skills. Good content and resources.
    I would definitely recommend someone who is new to programming and wants to hone his/her skills to improve their ability to code.

  • @pmiron
    @pmiron 4 года назад

    Great talks! Gives a lot of clever ideas.

  • @jhunbado265
    @jhunbado265 4 года назад +4

    Take a shot whenever he drinks water. 🍺😄
    Great talk btw.

  • @salous428
    @salous428 4 года назад

    Maybe not the topic of this talk but speaking of OOP, polymorphism and readability in general, the question that comes to mind is how would be the best way to organize all those classes inside the code. For example, all classes inheriting from EventsList are stored in a same file (module) one after the other? EventsList should be defined close to where it's being used or it doesn't matter at all?

    • @doeXCI
      @doeXCI 4 года назад +2

      I personally would start with one file containing the abstract class and all its children and move to a folder with one file for each once the single file becomes too big, like over ~300 lines

    • @sivscripts860
      @sivscripts860 4 года назад

      Agree with Johannes. Single file until things become hard to manage.
      You can see how I set up the EventList class and its children on GitHub
      github.com/busy-beaver-dev/busy-beaver/blob/d16641f34586eb0b178622cc09750be4ad8bee6f/busy_beaver/apps/github_integration/summary/event_list.py