3 ms·
I really appreciate your offer regarding PM, and the time you took to write that post. As you figured, I have learned those easier parts of not making things gl
by phpthrowaway99 4y ago
I really appreciate your offer regarding PM, and the time you took to write that post. As you figured, I have learned those easier parts of not making things global, writing functions, separating files, all that. The way you explained it does make it clear that OOP could be the next step in helping me keep my sanity and my code clean. Since writing this post I looked up a few explainer videos regarding OOP and somewhat get it now.
I somehow get the feeling that if you do a good job with functions, it's almost working the same way. But I'm sure there's still parts I'm missing.
I appreciate your offer but I don't think it's fair to use your time when I haven't personally tried to use the countless resources explaining OOP that are available online.
I'll look into them so I know what the possibilities are when I work on my next project.
Thank you for the response.
- bluefirebrand 4y ago> I somehow get the feeling that if you do a good job with functions, it's almost working the same way. Yes. A lot of what people profess about the "clean" ways to write OOP is essentially just the same as using Functions with Namespaces
- civilized 4y agoWhich you can do with modules in Python, so the particular utility of classes gets increasingly hard to tease out. One neat use of classes is model objects in scikit-learn. But R manages to do the same thing with a much more basic system called S3. In this system, you have "generic" functions which dispatch to different methods based on the data type of the first argument. This is used to endow the programming environment with predict and plot functions that behave differently depending on what kind of model you feed into them. This is essentially the same as how two different OOP classes can have two different methods with the same name. But S3 has none of the other trappings of object-oriented programming whatsoever: no encapsulation, no inheritance, no polymorphism. I found it a fascinating revelation. It's hard to point to anything that R's object system makes unnecessarily difficult, any killer app that proves how pure OOP is better. I would guess that traditional OOP excels in GUI systems, but outside that context, people seem to increasingly find it wanting as a paradigm. We are seeing an evolution away from unipolar OOP ideology and towards a more multipolar exploration of different paradigms and their comparative advantages.