Reflection on Design Patterns

05 Dec 2017

In any situation, it's a good idea to befriend patterns. We are busy human beings. We have countless things on our agenda and there are simply not enough hours in the day to spend doing tedious work over and over again. Imagine a world where patterns do not exist. For example, artists would suffer. Although it is very much possible to draw a pattern for, say, a wallpaper over and over again, but who wants to do that? First and foremost, there will be no consistency. The first few bits of the pattern will be perfect of course, but by the 50th time you're doing it, it'll more than likely end up looking like your 3-month nephew took over while you passed out from exhaustion. Secondly, nobody has time for that. No one wants to spend hours upon hours doing the same thing over and over and over again. Boredom will strike, and what was once a fun project, will turn into a tedious chore. This is exactly why patterns are a must. Instead of having to manually draw something repetitvely, we come up with a simple solution: create a stencil. That way, it's as simple as copy and paste. And what would have taken you hours has now taken minutes, while at the same time, keeping the consistency between the first stencil and the last.

It is no different for coding. The concept of coding itself is tedious. And if there's one thing that most coders can agree on it's that the most annoying thing about programming is spending hours trying to figure out why your code doesn't work only to see that it's something as miniscule as a spelling error or a missing semi-colon. Careless mistakes like that happen when we spend hours on a single programming project. Fatigue sets and we are more susceptible to doing small mistakes without even noticing. The solution? Like all things, design patterns. When following template, which is basically to programmer as stencil is to artist, it significantly lowers the chance of making small errors like that, while at the same time speeding up the process to begin with, because most of the dirty work is filled in for you. Now you are at least little less tired, which makes you more focused and able to catch slight errors you might make along the way.

For my software engineering class, the final project we are working on requires us to build a sort of makeshift app that allows students to vote for what they would like to see in the vending machines on campus each month. In order to make the process of developing the app easier, we used a template from our professors’ example app called Bowfolios, that also allows UH users to interact with some form of campus related problem. We use the many design patterns provided by Bowfolios in order to create the basic concepts of our own app, just altering the code to fit to our standards. Without this template, all the work we would have to do would be by scratch and maybe take us the entire semester to complete, depending on how intricate we wanted it to be. However, design patterns came in clutch and we are now able to do what would've taken six months and condense it to two. It allows us to focus our attention to the details of our project instead of burning us out from trying to create all the basic aspects of our app. Like the artist, we are left with a much more consistent and well thought out masterpiece, while also finishing it in half the time it would've taken us to do it manually. This, ladies and gentlemen, is exactly why design patters are so important not only in software engineering, but in our everyday lives.