What problem do they solve?
If we refer to general code patterns established within a team:
- We use it as an opportunity to discuss benefits and tradeoffs of some patterns around an issue, that are very specific for our applications, business logic and team makeup
- Once we’ve agreed on something as a team, we put it in a code patterns repo with some explanation of why and how we arrived at this agreed pattern.
- It reduces our cognitive load and helps with onboarding. It also helps with introducing a new team to working on the same repos.
- In practice we have done this for patterns in our React, Node and Spring Boot apps.
If we refer to general Design Patterns within the Object Oriented Programming (OOP) paradigm:
- They are good for managing dependencies for your code. It is about arranging what code you have so that it will be easy to change. – An almost word-for-word extract from Practical Object-Oriented Design: An Agile Primer using Ruby (POODR) by Sandi Metz
If we refer to the Gang of Four Design Patterns published in 1995:
- Statically-typed Object Oriented Programming (OOP) languages, and in particular, Java (verbose and old school).
- I tried to re-create these design patterns in Kotlin, and found that quite a few patterns that I selected were solved by the language itself.
- I could be wrong on the first point, as there are resources that do not restrict their materials to using Java as examples.