Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: patterns, language and syntaxby clemburg (Curate) |
on Aug 20, 2001 at 21:10 UTC ( [id://106275]=note: print w/replies, xml ) | Need Help?? |
Most books are about languages (and how to use them) and algorithms. This one is original because it focuses instead on higher object oriented patterns not captured directly by syntax of current languages (but can nevertheless be expressed in them). It names these patterns and describes them, giving a common vocabulary to programmers. You might be interested in Design Patterns in Dynamic Programming by Peter Norvig. This presentation shows how to express common Design Patterns in Common Lisp.
It classifies Design Patterns into three levels:
And concludes:
16 of 23 patterns are either invisible or simpler, due to:
This matches my personal observation that after learning programming in Scheme and Common Lisp, I often find the standard object-oriented languages like C++ and Java to be clumsy and lacking abstraction features (no functions as first-class objects (no closures, no functions as return values), no access to continuations (call-with-current-continuation (call/cc)), no macros, just to name the most important ones). Patterns like "Strategy" or the common C++ "Functor" idiom simply look like an indicator of poor language design when viewed from the perspective of a language with first-class functions. The paper continues with an interesting historical observation:
Long ago, subroutine call was just a pattern
So yes, indeed, the real task is to put all these Design Pattern stories into code. If the languages we use do not support this, we should change them to do so.
Christian Lemburg
In Section
Meditations
|
|