E
E
Eugene Zalivadnyi2015-11-26 03:37:06
Design patterns
Eugene Zalivadnyi, 2015-11-26 03:37:06

How did you master design patterns?

It is clear that in order to learn to program, you need to constantly write code. The question is where to start in the case of patterns?
What small problem can be set to solve it with the help of patterns?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
C
Cat Anton, 2015-11-26
@agnamanshamansky

Here are 12 small tasks for 12 patterns:
github.com/zfcampus/zendcon-design-patterns
1. Open the folder with the pattern.
2. Read the README.md for the task description.
3. Open exercise.php and try to solve the problem using the appropriate pattern.
4. Remember the theory if necessary: ​​github.com/domnikl/DesignPatternsPHP
5. Check with the solution in solution.php.

M
Mike Butlitsky, 2015-11-26
@goodprogrammer

The dangerous path is to force yourself to apply patterns. Patterns are not a magic pill.
It is much better to sit down and think about the solution yourself, then decide, fill the cones and study the patterns after a while. Then there will be a real understanding of where and how to apply them.
And then such a nabydlokodite that mom do not grieve :(

L
lomikman, 2015-11-26
@lomikman

It is better to start in practice with simple patterns (singleton, fabric). Try to learn how to simply "see" them in the libraries you use first. Then you can look at the implementations and try to apply them in your own code.
The fastest way to level up is to code something, then ask a friend / expert / uncle with experience for money / beer to comment on the code and build the architecture (repeat n times). Then you will understand why they are needed and their areas of applicability.
The main thing is not to fall ill with the "brain design pattern" - this is when the coder puts patterns where it is not necessary, "if only they were", following fashion trends.

K
Konstantin   , 2016-11-01
@SynCap

damn, here is a magic pill
for 10 minutes - and you can bend your fingers in cool smoking rooms and at job interviews

P
Pavel K, 2015-11-26
@PavelK

In my lifetime, "tyutelka in tyutelka" did not fit any of the templates.
Just understand what they are, but do not strive to follow them thoroughly, otherwise such shitty code will be terrible. Although, maybe I have not mastered them in my five years ........

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question