We all know design patterns and we love them. They make it easier to talk about the design of our code and that's what I think they are good for.
But occasionally I had the joy of maintaining code that seemed to be build around design patterns completely. At first I was impressed (when reading the design documents). But when digging deeper into the code it became more and more obvious that thinking in patterns is a bad idea.
A pattern in my eyes is just a name for something that a good programmer should come up with when solving a particular problem even if he didn't knew about that pattern before. I often had this situation: Solving a problem by writing code and later recognizing that I used a specific pattern.
But trying to throw patterns on every problem you encounter will result in over complicated, bloated and over engineered code.
Maybe it's some sort of uncertainty that leads developers to over use design patterns. They think: If I can refer to a pattern it can't be wrong.
Don't get me wrong: Design patterns are not a bad thing but over using them can be dangerous. As everything in life it's all about balance.
No comments:
Post a Comment