0

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!

7 Answers 7

4

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.

Sign up to request clarification or add additional context in comments.

Comments

3

If you don't count indirect jumps, there's nothing on the hardware level that gives OOP a low-level advantage. (But jump tables had been in use for ages before OOP became widespread.)

The main advantage of OOP is just the ease of modelling. Which also sets out the boundaries of OOP's usefulness, as some problems don't lend themselves to OO type modelling.

Comments

3

They will tell you a lot of things, but two most important reasons are :

  1. Thinking in terms of objects is inuitional for humans.
  2. Maintainability

Comments

2

All programs run on the same hardware. Each evolution step in the area of software development always only makes it more simple to express what we want.

Comments

2

OOP is used to make programming easier for humans. But close to human mean farer from the machine, so you could say, to a point, that OOP is not really meant for very low-level task.

Comments

0

OOP it's not a hardware, physical issue.

It's all about of how to find better coding practices which empowers productivity, efficiency, scalability and maintainability.

In instance, it has evolved because it provides features that have shown success stories during last 20 years, starting with first not that OOP Smalltalk, C++ to Java, C#, Ruby, Python and many others.

Any other point about hardware optimization is an implementation decision by a concrete OOP programming language compiler or interpreter.

So, at the end of the day, the question should be, "is this OOP-based programming language hardware optimized in a better way than some other one that's based on structured programming?".

Comments

0

I don't think OOP is applicable at a low level (if I understand you correctly) as it is an abstraction (like many other software development paradigms) and it makes sense when you build your software using some higher level constructs, but not machine code, for example.

In any case, if you introduce OOP on low level (let's say allow inheritance on CPU level) that will most likely be a higher level abstraction implemented on top of the exsiting CPU commands anyway.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.