J
J
jesudode2018-11-13 08:37:13
OOP
jesudode, 2018-11-13 08:37:13

What programming problems does OOP solve?

“OO seems to bring at least as many problems to the table as it solves.”
Jeff Atwood.

What are the problems that are solved in the OOP, are we talking about?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
E
Eugene, 2018-11-13
@jesudode

OOP allows you to really manage complexity, as mentioned above, and increases the reusability of code.
But there are many OOP languages, and even a clear definition of what OOP is, and in what situations to use it, does not exist.
For example, when I look at the Java code, it seems to me that there is a huge amount of boilerplate and overcomplications like:

EnterpriseBusinessFactoryJavaBeanFactoryFacade
.factoryMethodCreateDependencyInjectionStrategyMethod()

As with any other tool: you can use OOP wisely and for its intended purpose, or you can use dozens of patterns, abstract classes, factories, etc. to print "Hello, world". There is no explicitly defined path from the second to the first. Innate ability, analysis, and lots and lots of practice.
But to say that this is an inherent flaw in OOP is a clear clickbait. Similarly, you can write bad code in any programming language and in any paradigm.

E
EVGENY T., 2018-11-13
@Beshere

The main problem that OOP solves is complexity management. This is where the main disadvantage of OOP comes from - if you don’t need to manage complexity, then it is redundant. Beginners are discouraged if it takes a dozen lines of code to write a hello world.

X
xmoonlight, 2018-11-13
@xmoonlight

Entirely depends on the context of the content.
Provide a link to an excerpt from the text of the book or publication.
1. OOP solves the problems of uniqueness, structure integrity and controllability of the project code.
2. The author has never created complex applications:

I'm not a fan of object orientation for the sake of object orientation.

3. This is a banal desire to promote using the OOP performance as an argument (or simply the inability of the majority to manage it by monitoring the states of the nodes of the OOP structure).

A
Alexander Skusnov, 2018-11-14
@AlexSku

You just need to know the history of the appearance of objects.
Here is an example from Pascal. At first there were simple types: logical, integer and fractional numbers, symbols. A lot of identical data resulted in an array (including character strings). Added range and set. Scattered data led to a record (record, for sishnikov - structure). We added functions to the structure - objects and classes appeared. Inheritance and dynamic (virtual methods) appeared. Separately came interfaces (structures with some functions).

S
Saboteur, 2018-11-13
@saboteur_kiev

OOP allows programmers to write not the whole program, but separate objects.
If you hire 1,000 programmers to write one procedural style program, you'll have a huge amount of man hours just solving conflicts and waiting for each other.
But in OOP, you can immediately architecturally divide the writing of a program into independent objects, and programmers will be able to work almost without interfering with each other.
For small programs, OOP is not necessary, but if you are already an experienced programmer, you will easily use OOP for everything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question