When is Object Oriented not the correct solution?

2019-02-03 16:46发布

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.

15条回答
时光不老,我们不散
2楼-- · 2019-02-03 17:21

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).

查看更多
Emotional °昔
3楼-- · 2019-02-03 17:21

I wouldn't bother with OOP if the programming language that you are using doesn't easily allow you to use OOP. We use a BDL at my workplace that is made to be procedural. I once tried to do some OOP, and well, that was just a big oops. Shouldn't have bothered.

查看更多
We Are One
4楼-- · 2019-02-03 17:23

The advantages of OO design are expandability and maintainability. Hence, it's not of much use where those features aren't needed. These would be very small apps, for a very specific short-term need. (things that you would consider doing as a batch file or in a scripting language)

查看更多
Root(大扎)
5楼-- · 2019-02-03 17:25

Not good enough? I don't know if I can come up with an example of that, but I do know that some REALLY simple applications might not see any "benefits" in the beginning of using a fully object oriented design model. If it is something truly procedural and trivial, however, in the end, it might need to be re-visited.

查看更多
看我几分像从前
6楼-- · 2019-02-03 17:28

I would sudgest you visit wikipedia and read their articles about different types of programming languages.

Saying that a type of programming "isn't good enough" doesn't make any sense. Each type has a purpose. You can't compare them. They're not made to do the same thing.

查看更多
霸刀☆藐视天下
7楼-- · 2019-02-03 17:31

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.

查看更多
登录 后发表回答