Humans are constantly searching for patterns in everything we come across, it’s how our brain works. Patterns can enable us to find more efficient ways of completing a complicated task. For example, someone new to calculus may use the given formulas to find the derivative or integral of a function, which can be time consuming and creates a larger margin for error. Someone more experienced in calculus would more likely use a mathematical shortcut, which is really just a solution generated by an observation of a pattern. This saves time and effort, which can be better spent on a more interesting and complicated problem.
Programming follows a similar model, design patterns being the “shortcuts”. When creating a program, yes it is possible to have every line of functioning code come from you’re hands, however would it not be better to use a design pattern that has been proven to work? At the same time, finding anti patterns in a program is a good sign that changes need to be made. Design patterns, like mathematical shortcuts, give us a general solution to a various number of recurring problems. This allows us to focus on further advancing human knowledge, rather than rediscovering it.
The idea of programming with design patterns in mind is still new to me, or so I thought. After recently learning about a few basic design patterns, it became clear to me that all of my professors in current and previous courses had already been teaching with these design patterns in mind. I had been using numerous design patterns for many of my past projects and assignments. The most recent project I completed (ICS 314 Final) follows the Model-View-Controller (MVC) architectural pattern, using React, ReactRouter, MongoDB, Meteor. Going forward, I would like to learn a lot more about different design patterns so I can used them to improve myself as a programmer overall.