5 ms·
Design Patterns in Dynamic Programming (1996) [pdf]
- neilv 7y agoThe title might be confusing today: today, the title might instead say simply dynamic languages, rather than the dynamic programming that makes people think of current coding interview customs.
- adenadel 7y agoI was looking forward to reading Peter Norvig's writing on dynamic programming :(
- neilv 7y agoI was looking forward to blaming Peter Norvig for the current software developer interview theatre shibboleth. :)
- acuozzo 7y agoIt makes me think of this: https://en.wikipedia.org/wiki/Dynamic_programming https://en.wikipedia.org/wiki/Dynamic_programming
- codesushi42 7y ago>dynamic programming that makes people think of current coding interview customs I laughed. There are real uses for dynamic programming though. It is sad that only the lucky get to work on those types of problems.
- dang 7y agoA thread from 2010: https://news.ycombinator.com/item?id=1059822 https://news.ycombinator.com/item?id=1059822
- wwweston 7y agoKey takeaway point: "Dynamic Languages have fewer language limitations, less need for bookkeeping objects and classes, less need to get around class-restricted design. Study of the Design Patterns book: 16 of 23 patterns have qualitatively simpler implementation." Or as someone else once put it, "design patterns" might more accurately be called something like "palliative idioms for pain points in static manifestly typed class-oriented languages." That's a little bit unfair, given Smalltalk's place in all this, but one of the wastes of time over the last 20 years has been the ways in which some dynamic languages cargo-culted practices from, say, the Java world because Design Patterns™ were The Mark of A Professional™. The fact this happened in JavaScript with Angular is particularly atrocious.
- erokar 7y agoI agree. The creators of Angular came from the Java world, and it shows.
- mr_crankypants 7y agoIt's unfair, but also pretty decent. For my part I've often wondered if design patterns being such a big deal in OOP is really a failing of the object oriented paradigm itself, or if it's just a reflection of how, ironically enough, popular object-oriented languages tend to be really, really bad at polymorphism. You're right, Smalltalk looms large here.
- 6thaccount2 7y agoYep...there are dynamic languages (Ex: APL and Common Lisp) where you can use OO primitives, but it usually isn't as encouraged if at all. I don't recall hearing much about proper design patterns in those languages. I'm not saying they don't exist, but it isn't a big deal. Smalltalk on the other hand forces you to do OO and I just read most of a book on the proper design patterns to use in it. It certainly isn't as bad as when I started to learn Java (it's almost a minor miracle to me that as much stuff gets built in Java as it does with all the straight-jacket boilerplate it has) but it is definitely there. Especially in the scripting arena (shorter programs of maybe a page or two) I find that nearly all OO scripts I see would generally be shorter and clearer as a few global data structures and some functions to operate on it.
- kazinator 7y agoOn the contrary, Common Lisp codebases nowadays are almost annoyingly replete with OOP.
- 6thaccount2 7y agoPaul Graham save us all ;)
- mr_crankypants 7y ago
- tosh 7y agopg in http://www.paulgraham.com/icad.html http://www.paulgraham.com/icad.html (via http://wiki.c2.com/?AreDesignPatternsMissingLanguageFeatures http://wiki.c2.com/?AreDesignPatternsMissingLanguageFeatures) > This practice is not only common, but institutionalized. For example, in the OO world you hear a good deal about "patterns". I wonder if these patterns are not sometimes evidence of case (c), the human compiler, at work. When I see patterns in my programs, I consider it a sign of trouble. The shape of a program should reflect only the problem it needs to solve. Any other regularity in the code is a sign, to me at least, that I'm using abstractions that aren't powerful enough-- often that I'm generating by hand the expansions of some macro that I need to write.
- xtracto 7y agoFor me, patterns define ways how you put language constructs units together to solve typical "higher-level" problems. For example, "how do I implement an undo mechanism". Of course for static/object-oriented languages, the patterns will be different than for dynamic languages. I am currently listening to the Software-Engineer Radio Podcast from 2006/2007, and they talk heavily about patterns. Even though the POSA books patterns may not be applicable to dynamic languages like Ruby or JavaScript, I think the right idea is to define new patterns that are useful for these type of languages. Maybe one reason why we don't have this is because nowadays to solve a more "specific" problem the only thing you need to do is to install some third party library from github that already does it? (like if I wanted to implement an undo-redo fucntionality I will use maybe this: https://www.npmjs.com/package/undo-redo https://www.npmjs.com/package/undo-redo )
- sampo 7y agoThis is about dynamically typed languages, not dynamic programming the mathematical optimization method.
- gitgud 7y agoYes, I was initially confused too. Maybe the term "Dynamic Programming" wasn't a popular phrase back in 1996?
- asimpletune 7y agoI thought this was about dynamic programming. Maybe the title should be changed?
- timClicks 7y agoI never knew that Norvig worked at Harlequin and was a Dylan advocate