2 ms·
So, "Are Design Patterns Missing Language Features"?
- dragonwriter 13y agoIf, in any given language, you need to write out a prose recipe or code template for how a design pattern is implemented in that language, then that's an indication of a limitation in the expressive power of the language. If you can implement the pattern generally (not just a specific, limited form of it) in a library/package etc. and just use the implementation from consumer code, then you aren't running into a language limitation. This doesn't mean that the pattern itself, even in that case, is a missing language feature: while in some cases things that can be patterns in one language may be basic independent language features in another -- e.g., "classes" or might be recipe-driven "design patterns" in C but basic language features in Java -- they are just as much not a sign of a language expressiveness limit if you can implement them as library code in a general form, even when they aren't basic language features (e.g., "classes" in JavaScript.) And, even when language can express them in library code, that there is a value to doing so may not be clear until the patterns have been catalogged. The basic upshot isn't that design patterns are missing language features so much as that the design patterns you need a cookbook rather than a library for are a function of language features (you still -- whether in cookbook or recipe form -- benefit from understanding the pattern, motivating uses, considerations that apply to using the pattern, etc.; the difference in whether you are going to need to code the specific use yourself or be able to grab library code and call it with appropriate arguments when you need to use it.)