Normally we see the design pattern as a cake recipe. It is a model to be followed. It’s a way to encode something to get a certain result, a certain solution. Usually these recipes were created by those who have had the problem, thought a lot about it and found a solution that can be universal.
Recipes focus more on very specific problems and probably form idiomatic. Dps are more conceptual and focus on the problem, more than on the implementation.
Design patterns are ideas, not tools, technologies, products, methodologies, paradigms, etc.
There are some famous patterns that are very common in many applications, but nothing prevents you from setting your own standards for specific applications if it can repeat in your work.
Some of these patterns are documented and examples are provided. Some may be more automated and a library or framework can be made available to facilitate its implementation and use.
Others are so common that they can be inserted within the programming languages to facilitate even more.
Patterns that have gained fame
When people think about Pattern design it is common to think of the main ones, defined by the Gang of Four group. They also think of patterns like MVC (though more of an architecture standard) and similar ones, but forget that everything is standard design.
Patterns are all over the place
High-level programming languages are all based on design standards that were used when programming in Assembly in the early days of computing. They made some code patterns often so it would be better to abstract that.
For example, a variable is a design pattern to access a value in a given memory address. You won’t read this in any list of patterns, after all it has become so common, so transparent, that no one else thinks of it as a pattern.
Language flow control constructs are Patterns design deciding and deviating the order of execution from the instructions.
Object-oriented programming is a paradigm composed of a set of design patterns. So up to can program OO without a proper language for this.
Inheritance is a form of code reuse that takes advantage of a standard set in another class.
When you use a dictionary you are using an access pattern to a key and value data structure. When you make a quicksort, is using a pattern.
Using right
It is a mistake to reduce the standards to these known ones, and even more, to try to adapt every code to a pattern. There are those who program "pattern-oriented," and usually commit atrocities in the code because of this. In fact the Gof came to disseminate the term, but also to misrepresent what it really is. Do not get carried away by the use of fashion. This limits his real usefulness.
You have to know when to adopt it, when to adapt it, and when to ignore it. Of course, if you don’t know all the best known ones you run the risk of reinventing the wheel in a worse way, but trying to use a pattern where it doesn’t fit, also brings disastrous results. No need to keep looking for pattern at all.
When you think of your application as always creating a new pattern it can be easier to find out if there is one that can already be applying, or it can make it easier to understand what you are doing. Reusable solutions are usually clearer.
Formalized standards have a meaningful name, explanation, context, and example of implementation.
Besides Gof, there are other collections of patterns: A Pattern Language, Portland, Coplien, POSA and EAA, only to name the best known.
Related.
See if that helps you understand, I gave a read and found it very enlightening.
– user28595
Design Pattern is when you use Singleton (lol).
– Caffé
Did any help you more? You need something to be improved?
– Maniero
I’d even create a separate answer, but the other answers pretty much speak volumes. I’ll show you this site to check it out: https://refactoring.guru/design-patterns . In addition, I recommend taking a look at the courses of Alura (I’m not doing advertising, I just did them and found great) or others on the subject, to have a clearer idea about the theme and where to apply it in practice.
– Arthur Siqueira