When to reorganize a design template?

When coding and viewing code, it is easy to identify places where a design pattern can be used. The chain of command is here, the strategy is there ... It is tempting to dive and apply patterns, even if a switch or some simple if's might be the best solution.

Are there any rules or tips that you found valuable to evaluate when to do the actual refactoring?

Wait until it's too hard to add features? Wait for the third time you change the code? First time you need a hack?

+3
source share
2 answers

/ , , .

, - , . , .

, , . , . , , .

+2

- , . , ( ). , , (, , testablity), .

, , . , , .

+1

Source: https://habr.com/ru/post/1752315/


All Articles