When should I use—and not use—design patterns?
- by ashmish2
In a previous question of mine on Stack Overflow, FredOverflow mentioned in the comments:
Note that patterns do not magically improve the quality of your code.
and
Any measure of quality you can imagine. Patterns are not a panacea. I once wrote a Tetris game with about 100 classes that incorporated all the patterns I knew at the time. Why use a simple if/else if you can use a pattern? OO is good, and patterns are even better, right? No, it was a terrible, over-engineered piece of crap.
I am quite confused by these comments: I know design patterns help to make code reusable and readable, but when should I use use design patterns and perhaps more importantly, when should I avoid getting carried away with them?