3 ms·
> Languages with metaprogramming, like the Lisp family of languages, avoid the burden of having to do this Using macros or higher order functions doesn’t make
by bjpbakker 9y ago
> Languages with metaprogramming, like the Lisp family of languages, avoid the burden of having to do this
Using macros or higher order functions doesn’t make the concept of a pattern go away. In Lisp you also use adapters, factories, strategies and the like. They’re just simply functions rather than overly complicated objects.
Since its only functions on data structures, chances on reuse are indeed much larger.
- flavio81 9y ago>They’re just simply functions rather than overly complicated objects. And thus the pattern becomes almost invisible. Instead of having to fully apply it the java (or C++) way, that is, for example creating a separate class for each Strategy, etc.
- bjpbakker 9y agoExactly. My point was more that the OO patterns refer to general concepts, that are useful to be able to recognize without objects cluttering your view. I believe we're on the same page :)
- ivan_gammel 9y agoSoftware design pattern is a mental and communication concept, which has nothing to do with compilers/languages/etc. Design phase happens before you start writing your code - you have to first think about how the system will work and what will be its internal structure, and that's the moment when patterns start working. Then, even in Java you don't have to call your class "SomethingStrategy": you may simply follow the pattern to correctly implement what happens to be a strategy or to explain the behavior of the component to your colleagues. When you have the common language based on pattern names, it's much easier to say: "Look, this is a Builder for data model, which offers convenient internal DSL", rather than explaining everything from scratch. Patterns are ubiquitous tool for developers, not an evil. The evil is incompetence, with which some people blindly apply various programming concepts in totally inappropriate ways (including design patterns, functional and parallel programming etc).