K
K
Kotaro Hiba2019-09-06 10:59:55
PHP
Kotaro Hiba, 2019-09-06 10:59:55

What do you need to know about OOP?

Greetings to all programmers, I recently delved into OOP in php.
Tell me where you can get comprehensive information on how to work with OOP, I know how to use the reference book, but when you don’t know that it’s not very easy to google it, and which site has a good collection of problems for this topic?

Answer the question

In order to leave comments, you need to log in

7 answer(s)
G
Grigory Vasilkov, 2019-09-06
@lina666

And I would add that OOP is a decoration of the code, and not its essence
. Now there are ways to pay Amazon and not write code at all, creating apishki in the admin panel using the mouse. All that will be needed from PHP is to make simple scripts that transfer data from point A to point B. There will be no need for OOP at all, because there will be no concept of a "whole project" within the folder with files. A whole project will be a bunch of computers, and this one specifically has a transfer from A to B. And then PHP people will laugh)) They are ready for this
. Seeing that you liked the first answer (maybe you were looking for it?), I will try to explain it for those to whom the terms do not mean anything:
(the article was moved to Google Docs for the need for clarification)
https://docs.google.com/document/d/1zs71d9OlgnaeIj...
I think now you will see how great architects will come running who gave you advice on these words and start saying something not about this, but this is not so and this is not here. Here is another thing you need to know about OOP. You will never hear that you are right, because the terms have replaced their brains, and if you tell them about it, they unite in flocks to fill you with stickers and humiliations.
And I would add that OOP is a decoration of the code, and not its essence

L
Lazy @BojackHorseman PHP, 2019-09-06
Tag

you need to know that going deep into OOP using php as an example is a bad idea

E
Evident, 2019-09-06
@Evident

There is only one name from OOP in php, because there is not even method overloading.
To understand OOP more easily, switch to Java or C#.

A
Andrew, 2019-09-07
@AndrewRusinas

I will write from the point of view of a Javascriptor. I am superficially familiar with php, and, as for me, it is a useless undertaking there. Like, sorry, php itself (purely my opinion, not for the sake of holivar).
OOP requires a completely different way of thinking. You will have to think very abstractly, sometimes thinking over the structure alone for weeks. And the problem with OOP is that it allows you to think about this structure for weeks, while with a functional / imperative approach, you could already write a working prototype and refactor. In fact, there are no advantages, again, from my point of view and experience. Since there is a lot of room for creativity, out of ignorance, you can complicate the entire code a hundred times, while OOP, on the contrary, is positioned as a paradigm that simplifies support.
For example, the User class. Maybe he knows how to write blog entries? Or maybe there is a Blog class with a .newPost() method? Or maybe even Post.new()?
For me, these things turned out to be redundant, although perhaps my lack of experience speaks and I will be glad if they correct me.

V
vanyamba-electronics, 2019-09-07
@vanyamba-electronics

I recommend reading Grady Booch .

S
Sandr-0, 2019-09-08
@Sandr-0

The list of OOP principles is sparse and does not cover everything. Read this:
https://en.wikipedia.org/wiki/Category:Principles_of...

R
rook_lem, 2019-09-07
@rook_lem

Everything you need to know about OOP:
1) It's not a "silver bullet"
2) It's the dominant, but far from the most correct paradigm
3) There are much more attractive, understandable and more reliable approaches
https://tproger.ru/ translations/oop-the-trillion-d...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question