Answer the question
In order to leave comments, you need to log in
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
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
you need to know that going deep into OOP using php as an example is a bad idea
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#.
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.
The list of OOP principles is sparse and does not cover everything. Read this:
https://en.wikipedia.org/wiki/Category:Principles_of...
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 questionAsk a Question
731 491 924 answers to any question