Answer the question
In order to leave comments, you need to log in
How to use design patterns in practice?
There is theoretical knowledge on all popular design patterns in PHP and JavaScript, what is their difference and how to work with them, but ... I don’t understand how to apply them in practice, what advantages they have compared to regular code and why they are at all needed at work, because everything is fine without them? In general, it seems to be good, but I feel that something is missing ...
Maybe I need to read some book that will make the necessary changes in the brain, or look at code examples on github?
Answer the question
In order to leave comments, you need to log in
why are they needed at all in work, because everything is fine without them?
It would be nice to read something like this - www.ozon.ru/context/detail/id/33506422
View code examples - it would probably be better on the example of a popular framework.
Understand how it works, where what patterns are applied and what problems they solve.
I would recommend Symfony - https://github.com/symfony/symfony
It will come by itself. At one fine moment, you will think, and it would not be bad to put a class factory here instead of a thousand if. Or, here you could put a singleton for the database class, instead of constantly creating objects
In general, it seems to be good, but I feel that something is missing ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question