5 ms·
Adhod. I have 18 years of professional experience with OOP, all of it a bloody waste of time. Exhibit: https://youtu.be/ns7jP1-SRvw?si=4NyOYebqtobIkFfC https://
by zamalek 2y ago
Adhod. I have 18 years of professional experience with OOP, all of it a bloody waste of time. Exhibit: https://youtu.be/ns7jP1-SRvw?si=4NyOYebqtobIkFfC https://youtu.be/ns7jP1-SRvw?si=4NyOYebqtobIkFfC
- pjmlp 2y agoApparently not enough to actually understand OOP type theory.
- Ygg2 2y agoNo one that claims to know what OOP is, knows what it means. Because the term is loose and hard to pin down. If OOP encompasses both Smalltalk AND Rust, it's like saying your definition of X includes a neutron star and giraffe. By OOP type theory, you mean category theory? ---- Most what people recognize as OOP today is just Class/Inheritance oriented programming, and Rust doesn't belong in that camp, trying to use structural patterns from that kind of OOP in Rust is often a recipe for disaster.
- pjmlp 2y agoNot at all, OOP type theory is OOP type theory. Not what most people on the street think OOP is all, with their anti-Java bias, rather the Computer Science studies of type systems and their application across all forms of OOP in all programming languages ever invented. Rust has enough features from OOP type systems, regardless of the anti-OOP feeling trying to pretend it doesn't. Static and dynamic polymorphism, methods, data encapsulation, type dispatch, all there.
- Ygg2 2y ago> Not at all, OOP type theory is OOP type theory. Tell that to Google. OOP type theory returns mostly Category type theory as results. What sources do you have on OOP type theory? Our OOP classes were heavy on practical part and less so on theory. > Rust has enough features from OOP type systems It's missing inheritance. Without inheritance applying OOP design patterns just fails miserably. So on one side you have stuff like Java, C++, JS, Ruby, Python and on the other Rust. > Static and dynamic polymorphism, methods, data encapsulation, type dispatch, all there. By that definition, Python isn't object oriented (no encapsulation), and C is. I think it's much more natural to reason about types on what they can do versus some nebulous definition. I mean any language worth its salt will have encapsulation. It's how you preserve your invariants. Method is mostly just syntax sugar. And static/dynamic polymorphism is just a fancy way to say we have function overloading and/or templates and/or vtables (even if using pointer casts).
- pjmlp 2y agoSearch better, look into SIGPLAN and IEEE papers. Class inheritance is not a requirement for OOP languages. I listed the OOP traits supported by Rust as a language. Naturally you have to nitpick it to try to make a point out of nothing. All high level languages are fancy ways to write machine code.
- Ygg2 2y ago> I listed the OOP traits supported by Rust as a language. So is the list missing items? > Naturally you have to nitpick it to try to make a point out of nothing. What did I nitpick? Does Python have encapsulation beyond gentlemen's agreement? Can't C have any of the listed behaviors?
- pjmlp 2y agoPython OOP != Rust OOP, but you naturally already knew that. However, in case you need some help, in regards to Python Classe inheritance, function and data members, dynamic dispatch, polymorphism, meta-classes. And even if C doesn't offer direct language support for a OOP type system, that isn't stopping anyone, like the Linux kernel and GNOME/Gtk+. Or publishing books on the matter, http://www.freetechbooks.com/object-oriented-programming-with-ansi-c-t551.html http://www.freetechbooks.com/object-oriented-programming-wit...
- Ygg2 2y ago> Python OOP != Rust OOP, but you naturally already knew that. No. Bold of you to assume that. I wasn't aware that one OOP isn't another OOP. I see, so OOP is a fuzzyish definition that you check more checkboxes to satisfy. If Rust is OOP, and Python is OOP and C is OOP, then the that circles back to my initial claims. A category that is so wide it's effectively useless. Compare this to sync and async. A precise definition, much greater informational content. You can prove something is pure or not[1]. Compare this to OOP, imprecise, less informational context, impossible to (dis)prove something is OOP or not. [1]https://www.youtube.com/watch?v=43XaZEn2aLc https://www.youtube.com/watch?v=43XaZEn2aLc
- IshKebab 2y agoCome on, it's an automatically generated dependency graphs of `#include`s which is totally useless, but hardly indicative of "a 5 year old being in charge". Absolutely nothing to do with OOP anyway. If you want that look at Java class hierarchies. I found this great art work to illustrate: https://www.researchgate.net/figure/Class-Association_fig3_228968993 https://www.researchgate.net/figure/Class-Association_fig3_2...