D
D
Dmitry2018-09-05 18:47:48
OOP
Dmitry, 2018-09-05 18:47:48

Why is OOP not OOP?

I was wondering what OOP is. At the university, they told me that it was about encapsulation, polymorphism and inheritance. And they say on radio and TV that this is completely different, that you can’t create static methods, you can’t make singletons, and in general that OOP (oh, God) is not about inheritance. And the one who coined this term generally said that C++ is not an OO language.
There are questions. Does OOP exist now in the form in which Alan Kay conceived it? Do we need the OOP that he intended? Is "true" OOP implemented somewhere? Why is OOP bad now? Why is C++ not OO?
You can recommend sources on the subject, books, videos, whatever. In which direction to dig?
And further. What is it for? What problems do I have when not using OOP? What does it decide?

Answer the question

In order to leave comments, you need to log in

9 answer(s)
D
Denis Shchetinin, 2018-09-21
@cosmoskey

Does OOP exist now in the form in which Alan Kay conceived it?

There are several implementations of the language (if it is a language) of Smalltalk. It was his Kay and his comrades who once created, developing ideas that he called the term OOP. I highly recommend getting acquainted: the probability of understanding what OOP is is maximum when it is used in practice, and Smalltalk is the most practical OOP. Of the existing implementations, I recommend Pharo [ http://pharo.org/] to look at. I myself earn a living from it, by the way - so this is not a "naked theory".
In some aspects, Ruby is close to Smalltalk ... But it is already much more complicated and ugly in itself.
Now there is no time to look, but Kay himself also said that, for example, Lisp is an object-oriented programming language. He said something similar (now I'm starting to doubt, but it seems to be) about Erlang with its Actors ...
> Do you need the OOP that he conceived?
Everyone must answer this question for himself. I think it is necessary (with some amendments).
> Whether "tru" OOP is implemented somewhere?
I think that (out of the existing ones) Smalltalk and Self have come as close as possible. There are connoisseurs of OOP through FP (although from time to time they say that they don’t really need objects - in general, they are muddy :) ... But Actors definitely deserve attention (especially considering that Hewitt was largely inspired by Kay’s ideas, and Kay also before that, he was largely inspired by the ideas of Hewitt).
> What's wrong with OOP now?
Mainly by the fact that he was perverted and dirtied without understanding.
> Why is C++ not OO?
Because C++ is "multi-paradigm" (although fans of this term seem to be unable to even spell it). For example, for me this means that it does not support any paradigm well.
> You can advise sources on this issue, books, videos, whatever.
There are a lot of sources, but at the same time it is very difficult to advise something. Mainly because no one has yet come up with clarity on these issues. At the moment, probably, everyone should find their own way in these wilds (either stay there forever ... or not meddle in them).
> Which way to dig?
I personally once upon a time began to dig in the direction of Smalltalk ... and since then I'm still digging :)
> And one more thing. What is it for? What problems do I have when not using OOP? What does it decide?
If there are no unresolved problems of your own, then perhaps it is better to wait until they appear, think about them on your own and then look around (at the same OOP, and not only) ... And then it will suddenly become clearer. This is how I "stumbled": while studying C++ for several years (it was still the 90s), I did not find answers to my innermost questions; advised to download and watch Smalltalk (then it was still Dolphin); just a few hours of "gazing" - and here it is Illumination! :) True, instead of the removed questions, she brought an order of magnitude more new, unanswered ones!

D
Dmitry Dart, 2018-09-05
@gobananas

And on the radio and TV they say that it's completely different

Do not watch the first and second channel, everything is lying there
These statements do not contradict each other. Static methods can be done, only their excess deprives OOP of its meaning and advantages
Direct speech and the author in the studio
Towards real projects, not theoretical research on TVs

S
Saboteur, 2018-09-06
@saboteur_kiev

OOP allows large projects to be written by a large number of developers with minimal conflicts.
When a program fits into the head of one programmer, preferably in a short amount of time, no paradigms are needed. If the program is too large, and there are many tasks, they need to be somehow divided into parts that could be programmed independently of each other.
Modules are too big. Decomposing the program into functions and procedures is not enough, a lot of dependencies.
OOP has its own problems - for example, a strong overhead for simple tasks.
But in general, this ideology turned out to be more convenient than others in the vast majority of cases. Allows you to write complex products by average programmers by parallelizing the process.
Inheritance, polymorphism are attempts to make OOP more flexible. The main task is, after all, data encapsulation with methods that can work with this data.
Well, it is clear that when such a term was uttered for the first time, it was far from what the OOP has resulted in now.

E
Eugene, 2018-09-06
@immaculate

There is an ideal OOP in a vacuum, and there are real programming languages ​​and real problems.
OOP is not a silver bullet, it does not automatically solve all problems, just like any other approach, including functional.
It is possible to write object-oriented code in languages ​​without OOP support (in C, for example). It is possible to write procedural code in OOP languages. Encapsulation and polymorphism are generally rarely used in real life, but the desire of beginners to use polymorphism, singletons, and so on everywhere often leads to completely disastrous results.
To understand exactly how OOP helps, how exactly it interferes, what needs to be used, what is not needed, is possible only after several years of practical programming.

S
Stalker_RED, 2018-09-05
@Stalker_RED

What is it for? What problems do I have when not using OOP? What does it decide?
To manage complexity.
What is OOP for?

M
Maxim Fedorov, 2018-09-05
@Maksclub

This is a very holistic topic... it goes to extremes.
For example, there is Egor Buguenko, who drowns for the object, against inheritance, against anonymous letters, against ORM and . MVC
https://www.youtube.com/watch?v=ckjAWXJWZEY
Heated debate:
https://www.youtube.com/watch?v=AshxbePAbCM
The truth is somewhere in between
And yet -- there are other paradigms, such as functional programming as number one of the major paradigms

D
dllweb, 2018-09-05
@dllweb

Friend, what difference does it make to you, you would work first with some kind of project, and then you would understand what's what, and what - for what it will fit. Why do you need these phobias, what is right or wrong?

A
Alexey Skleinov, 2018-09-06
@lexskal

I liked it about phobias)))) I will briefly answer the last question. It does not solve problems, but when you understand the interaction, it helps to save a lot of time when developing applications. There is no need to repeat pieces of code, but to refer to existing classes and their functions. If you need to fix a specific function, it will be fixed in the entire project at once, no matter how many times you access it and from anywhere. Otherwise, all existing code would have to be parsed and each inclusion fixed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question