This is a question for people more experienced with Python, but everybody feel free to answer if you feel like you can provide something decent to the discussion.

Also feel free to explain why you feel that way and your experiences with Python and the paradigms.

  • danzania@infosec.pub
    link
    fedilink
    arrow-up
    11
    ·
    1 day ago

    For me it depends on the use case. If I’m designing something with an interface for someone downstream to use, I’ll usually define (data)classes even if I have a functional interface.

    For data science/modeling/notebooks I usually wouldn’t define classes.

    I think it also depends on your team; if everyone else is a functional programmer and you’re writing classes or vice versa, this will undoubtedly create frictions.

    • driving_crooner@lemmy.eco.br
      link
      fedilink
      arrow-up
      1
      ·
      1 day ago

      I use python for data sciences (kinda) and never write any classes or something object oriented, but given that dataframes are the bread and butter of everything I do, I guess I work in a object oriented workflow?

      • danzania@infosec.pub
        link
        fedilink
        arrow-up
        1
        ·
        18 hours ago

        Yeah that’s a great point – the dataframe is in a sense a class or object standardized for data analysis. Its flexibility (like being able to store arrays or dicts even) obviates the need in most cases for a user-written class.