Pitfalls of OOP and when to do functional #9
Replies: 1 comment
-
Hi, we are glad you like the content. Thank you for your suggestions! Our aim is to keep the scope of this material as narrow as possible, focussing chiefly on topics that are of great relevance to the machine learning field in particular and which are not specifically covered in detail elsewhere. As you correctly observed, we are obviously strong advocates of OOP. We believe that the benefits of OOP strongly outweigh the downsides. We do, however, concede that OOP is not easy to master. A lot of the perceived downsides of OOP, which you mentioned, often appear as a result of a sub-optimal use of OOP concepts; when applied correctly, OOP results in elegant, highly maintainable code that is easy to comprehend. If you can achieve the same goals without using OOP, then that's perfectly fine, but we would argue that, especially in Python, it would, at the very least, not be straightforward to do so.
Dominik & Kristof |
Beta Was this translation helpful? Give feedback.
-
Nice writeup! I think there are some very nice principles explained and the AI field really should figure out its design patterns more. Great initiative!
I have a some suggested additions:
Overall I'd suggest to highlight more the pros and cons of using classes vs using functions, and give readers a deeper understanding when to apply which.
In my personal opinion, the ML field tends to be too OOP oriented. Many engineers use classes for everything while it's not always the best way. Because of the stateful nature of classes and the tendency to hide complexity, I actually try to avoid using classes as much as I can.
Very curious about your thoughts on this!
Beta Was this translation helpful? Give feedback.
All reactions