How important are Design Patterns really?
Personally, I consider them vastly overhyped and of marginal value. The idea sounds great, but when you get down to it, there's really only a handful that common and useful enough to be worth remembering (and possible to remember).
I'd say their net effect is negative, due to the hideous overengineering perpetrated by people newly enamoured with the concept and trying to cram as many patterns into their code as possible. Perhaps even worse is the Maslow's hammer effect leading to bad design because instead of finding the optimal one, the developer remembered a design pattern that fits (badly).
We used design patterns in the 80's, we just didn't know they were design patterns.
They are not absolutely needed, but the good definitely outweighs the bad.
The good:
- Code readability: They do help you write more understandable code with better names for what you are trying to accomplish.
- Code maintainability: Allows your code to be maintained easier because it is more understandable.
- Communication: They help you communicate design goals amongst programmers.
- Intention: They show the intent of your code instantly to someone learning the code.
- Code re-use: They help you identify common solutions to common problems.
- Less code: They allow you to write less code because more of your code can derive common functionality from common base classes.
- Tested and sound solutions: Most of the design patterns are tested, proven and sound.
The bad:
- Extra levels of indirection: They provide an extra level of indirection and hence make the code a little more complex.
- Knowing when to use them: They are often abused and used in cases that they should not be. A simple task may not need the extra work of being solved using a design pattern.
- Different interpretations: People sometimes have slightly different interpretations of design patterns. Example MVC as seen by django vs. MVC as seen by Ruby on Rails.
- Singleton: Need I say more?
The single biggest benefit of design patterns in my opinion is that it gives developers a common vocabulary to talk about software solutions.
If I say, "We should implement this using the singleton pattern", we have a common point of reference to begin discussing whether or not that is a good idea without me having to actually implement the solution first so you know what I mean.
Add in readability and maintainability that comes with familiar solutions to common problems, instead of every developer trying to solve the problem in their own way over an over again.
Pretty important. Software can be made without them, but it's certainly a lot harder.