Design Patterns, A Important Tool In Problem Solving

27 Apr 2022

Design Patterns at first can help a beginner be introduced to a certain topic as they provide a clear outline of a solution to certain problems or rather a starting point that one can take to a solution. They can analyze these patterns and get into the general mindset needed to succeed in this industry. However, some people will follow these patterns too religiously leading them to try hammer in a design pattern to a problem that can have an entirely different solution.

Design Patterns as a First Try

Many people when looking at a problem will think to themselves, “Where have I seen this before?”, and if that doesn’t produce results we will then think to ourselves have I seen something similar? Design Patterns are a big part of this initial thought process as they are the starting point to eventually figuring out a solution. We draw on past experiences of known solutions, which in my experience can be simple things like when asked to sort a list, I would think of the very basic design pattern of a double for loop or more recently how we have built off of the meteor application template a good part of the semester and utilized its core functions to get our intended result of either building a user profile or implementing a website. Design patterns are a quick and sure way to get through these similar kinds of problems but how about entirely new problems, ones that we have never seen before? This is where design patterns could possibly be detrimental to ones learning.

Thinking Inside the Box

Now problem-solving is a vital skill in succeeding in any industry and finding new problems is no stranger to many people as being able to solve these new problems is a part of many jobs. However many people in these situations can tend to fixate on known design patterns and solutions and completely disregard any other kinds of solutions. This is a result of people applying these design patterns without knowing the underlying reasons or logic as to why these design patterns. Thus end up not knowing how to effectively use these design patterns and end up solely relying on past solutions to tackle new problems. This is nothing new to anyone however as this is something that everyone has come across sometime in their life, that in which most of the time we are just given the solution and explanation and not given the experience and further practice of trying to have more complex thinking instead of just memorizing formulas and known solutions.

A Useful Tool

That is why I like to now think of design patterns as more of a tool to use when approaching a problem. When programming, you are given a whole variety of options to approach a problem as it can be done in a thousand ways all with different kinds of code. We can use design patterns as a tool to fix together code that fits our desired solution rather than just tunnel visioning by forcing the problem to fit our design pattern. Thus we must be careful to not see design patterns as a solution but as a tool to help us get there.