3 ms·
You rarely use design patterns only once in a project. And while this quote does not cover it, you can also use macros to better communicate that one-off design
by TeMPOraL 10y ago
You rarely use design patterns only once in a project. And while this quote does not cover it, you can also use macros to better communicate that one-off design pattern instance - instead of identifying a pattern by noticing a set of familiar methods or a typical inheritance graph, the person reading your code can just see the the macro invocation and know he's dealing with a particular design pattern here.
Design patterns aren't bad per se, even if they imply some problems with language's capabilities to abstract - because they shift an abstraction from code to programmers' shared knowledge. The problem is with what I would call "design-pattern-driven development" - attempting to fit your problem into the bunch of design patterns you know. It's unfortunately very common.
- kyberias 10y agoI don't think there's such a problem really. We all try to fit the problems we encounter in designing software into a bunch of knowledge that we know. That bunch might be a set of design patterns. There's nothing wrong with that. Sometimes they fit perfectly and sometimes they don't. Sometimes the software we produce is not perfect.