|
|
|
|
|
by the__alchemist
55 days ago
|
|
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? |
|
However that is not the same as Python, which is 100% OOP, when using basic stuff like numbers, from Python language semantics those things are object, and there is the whole machinery in place even for basic stuff like addition.
And yes OOP is fuzzy from CS point of view there are multiple approaches and it doesn't get reduced to the way C++ and Java do it, just like FP and LP are fuzzy as well.
Some folks would swear if it isn't Haskell or Prolog, than it isn't FP or LP, when a CS book and programming language evolution will be more fuzzy.