I’m just wondering. What makes OOP significantly better than traditional structured programs. I understand encapsulation, inheritance, polymorphism, etc. What I want to know if there is a lower level feature, maybe hardware level, where OOP might be better. Thanks a lot in advance!
I’m just wondering. What makes OOP significantly better than traditional structured programs. I understand
Share
I don’t know that we can say “significantly better” in all cases. We don’t agree on what to measure, so “better” is hard to judge. And “significantly”? Even harder.
It’s also untrue that an object-oriented style is best suited to all problems.
I think object-orientation was invented because it maps well to a world that’s easily modeled with objects. Partitioning a problem into software components that maintain state and behavior together makes it easier to decompose a large problem into smaller, more manageable pieces. Allowing a component to own its data makes it easier to know where changes to state are made.
But we still have procedural, functional, and declarative styles of programming.