I've encountered lately some opinions saying that Object Oriented design/programming should not always be used.
Do you know some use-cases that will not benefit from and should not use Object Oriented design?
For example: there are some problems (concerns) that will benefit from AOP.
These include: design patterns, abstraction, encapsulation, modularity, polymorphism, and inheritance. When not to use OOP: Putting square pegs in round holes: Don't wrap everything in classes when they don't need to be. Sometimes there is no need and the extra overhead just makes your code slower and more complex.
In object-oriented programming, the open–closed principle states "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification"; that is, such an entity can allow its behaviour to be extended without modifying its source code.
An object can instantiate two classes is not true about the object oriented design of software.
There is no objective and available evidence that object-oriented programming is superior to procedural programming. OOP code is non-deterministic, which means that, unlike functional programming, we can't always expect the same result from the same inputs. This makes it difficult to reason about the programme.
Some problems are best expressed using other paradigms such as Functional Programming. Also, declarative paradigms allow more robust formal reasoning about the correctness of the code. See Erlang for a good example of a language with certain advantages that can't really be matched by OO languages due to the fundamental nature of the paradigm.
Examples of problem domains where other language paradigms have a better fit are database queries (SQL), expert systems (Prolog, CLIPS etc.) or Statistical computing (R).
In my experience one of the places that does not benefit from OO design is in low end embedded systems. There is a certain amount of overhead required to do OO and there are times you cannot afford this overhead. In a standard PC the overhead is so minimal it’s not even worth considering, however in low end embedded systems that overhead can be significant.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With