Let Me Ask Professor Google...

28 Apr 2022

“Design Pattern”????

Looking at the question “What is a design pattern?” is very intimidating. Even after staring at the question for 10 minutes straight, I still can’t think about what a design pattern could be. Since I was puzzled, I took this question to the all knowing Professor Google. Even after inquiring with Professor Google, I still have no idea what a design pattern is. Professor Google states that a design pattern is “a repeatable solution to a commonly occurring problem in software design”. At first, it seems like a “ask one question that raises more questions” kind of situation, but after letting this statement sit for a bit, I think I finally understood what a design pattern was. I realized that it was a mindset that allows programmers to tackle hurdles they may encounter while creating software. One form this could take is a programmer placing different console statements throughout their code to figure out what is going wrong. I think this is something that all of us can admit we have done.

Does it Look Good Yet?

While I was on my journey of figuring out what a design pattern was, I had to think of some examples of situations where I had to create a design pattern for my code. One was when I was creating my page for the final project website. I was responsible for creating a page that allows users to filter through a collection of clubs depending on the interest that the user selects in the dropdown menu. Depending on the interest the user chose, the results would appear as cards with the information of that club. For the life of me, I could not figure out how to actually implement how to search through the collection of clubs and grab the club’s information in order to put it in the card. I was setting up console.log statements almsot everywhere in my code in order to figure out what I was missing or what I was doing wrong. It was by following my design pattern of looking at the console that I finally figured out that I was not subscribed to the Clubs collection, and therefore I was not able to retrieve any information to put into the result cards. This also goes for when we were first introduced to using Javascript in the beginning of the semester. I would always place a plethora of console statements so I could figure out what was wrong with my code, even in the middle of the WODs. Even if I was in a panic trying to figure out why I was getting errors in JSFiddle, the design pattern helped me figure out what was wrong and fix it before the time limit. Another prime example of using design patterns in my code was early in the semester, when we were first introduced to using HTML. When we were introduced to the appearance of a website, I always played around with the padding and margins of certain aspects of the website. As minor as it seems, I believe this was also a design pattern that helped me figure out whether or not the websites we created were appealing to the eye or not.