Answer the question
In order to leave comments, you need to log in
What constructions do you write most/most of all?
It is interesting to find some common approaches/designs in as many routine/complex things that are done every day as possible.
In general, it does not matter on which framework or using which CMS you are writing an application. Also, if the things you indicated are already implemented best somewhere (in the sense of the most optimal) - I would be glad to hear.
I hope the comments will provide enough information to draw some specific conclusions about the general approaches to development, and how to optimize it, more interested in real practical experience, there are probably some things that are gradually getting out.
Answer the question
In order to leave comments, you need to log in
Thinking about it and running my eyes through the code, I found one such construction:
if (!isset($this->data)) {
$this->data = ...
}
return $this->data;
Patterns are not made everyday.
They are used in architecture design.
As a rule, this has been done for you by the creators of the framework for a long time, and you are left with only strategies and sometimes factories.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question