Design Patterns, and other such oddities
This week we discussed design smells (which I find endlessly amusing from a name standpoint), as well as the concept of design patterns. As a whole, design patterns are something that I had never thought of before now, though it makes perfect sense in retrospect. Programmers often run into the same kinds of problems or requirements for a project, so it makes perfect sense that we would have a set of designs that help to alleviate some of the problems surrounding them. I've always been one to writer code from scratch, or look up how to set something up in a basic sense, but these more abstract concepts aren't something I had put much thought or research into. The article I've chosen to read for this week is "The Problem with Patterns" from A List Apart ,which is a blog that specializes in having many writers from the Computer Science industry comment on various issues and topics. I figured that it would be a good idea to look at some of the problems with patterns, so maybe I could learn to avoid them, while using them for the first time.
The article talks about the problems with using design patterns, mostly from the perspective of the prospective user. Design patterns are good from the perspective of getting software completed and modular for the future, but most commonly used patterns focus more on just that, getting code done, rather than focusing on making it as usable as possible. This is compounded by the fact that since many designs are so readily available, it encourages programmers to use them without maybe understanding how they fully work, or the ramifications of using them in the first place. A design might look like it works for a specific purpose that suits your needs, but it most likely cannot be used for everything, so it requires more thought than just implementing them and being done with it.
We've mainly focused on one design pattern in class, the strategy pattern, but we've also been very good about mentioning some of the potential downsides of using it (Additional objects, more required knowledge, etc). After reading this article, I hope we remain this informed about any other patterns we might talk about. I can see that it would be incredibly easy to not think about the needs of your users and therefor make it much worse to use by not paying attention to the patterns I use, so overall, I think I'm just going to be more mindful of my programming overall. Patterns are great, but there's always a place for time to be spent on the designs of my code.
ARTICLE LINK: https://alistapart.com/article/problem-with-patterns/
Comments
Post a Comment