logoalt Hacker News

the__alchemistyesterday at 11:32 PM1 replyview on HN

I have found the definition of OOP to be fuzzy. For example, I don't see why having methods would make a data type object oriented. I associate OOP with factories, inheritance, using classes in places that might be functions otherwise, and similar abstractions.

Perhaps this is the counterfactual: I program in Python regularly, but don't program in an OOP style; I use dataclasses and enums as the basis, in a way similar to Rust, which by some definitions can't do OOP. So, if Rust can't do OOP (assumption) and I can write Python and Rust with equivalent structure (Assumption), does that mean Python isn't strictly OOP?


Replies

thesuperbigfrogtoday at 12:16 AM

> if Rust can't do OOP (assumption)

Rust handles basic OOP, but not all of the characteristics seen in C++ or Java:

https://doc.rust-lang.org/book/ch18-01-what-is-oo.html