N
N
Nazar Mokrinsky2013-09-28 18:29:03
PHP
Nazar Mokrinsky, 2013-09-28 18:29:03

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

3 answer(s)
Z
zloyusr, 2013-09-28
@zloyusr

Thinking about it and running my eyes through the code, I found one such construction:

if (!isset($this->data)) {
  $this->data = ...
}

return $this->data;

O
OnYourLips, 2013-09-28
@OnYourLips

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.

Z
zloyusr, 2013-09-28
@zloyusr

I think it's worth starting from here:
https://phpbestpractices.org/
http://www.phptherightway.com/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question