When should I be using classes in Python?

后端 未结 5 1982
星月不相逢
星月不相逢 2020-11-28 17:21

I have been programming in python for about two years; mostly data stuff (pandas, mpl, numpy), but also automation scripts and small web apps. I\'m trying to become a bette

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 17:43

    Its depends on your idea and design. if you are good designer than OOPs will come out naturally in the form of various design patterns. For a simple script level processing OOPs can be overhead. Simple consider the basic benefits of OOPs like reusable and extendable and make sure if they are needed or not. OOPs make complex things simpler and simpler things complex. Simply keeps the things simple in either way using OOPs or not Using OOPs. which ever is simpler use that.

提交回复
热议问题