I blogged yesterday
about Python and Haskell making you a worse programmer. A reader of that entry identifying (him|her)self as Reedo graciously posted a link to this Mark Dominus blog post
which talks about patterns driving the evolution of programming languages. The title of this post ("Design Patterns are Signs of Weakness in Programming Languages") comes nearly directly from Mark's blog. Here is his summary:
Patterns are signs of weakness in programming languages.
When we identify and document one, that should not be the end of the story. Rather, we should have the long-term goal of trying to understand how to improve the language so that the pattern becomes invisible or unnecessary.
This was a fantastic article well worth reading. Nothing in it failed my "smell test" from an initial read. The only thing that struck me as almost not right is that Rails and Subway aren't programming languages (he calls them programming systems, which is an acceptable title for them), so the codification and integration of MVC that he talks about doesn't seem to exactly fit since it's not taking place in the language proper. Or perhaps one proper place for such codification and integration in sufficiently high level languages as Python and Ruby is in libraries and frameworks?
I'm still mulling over the whole thing. But it's an interesting thought that if you find yourself repeatedly using a pattern, your language is broken in that regard.
thought you might like to look at both of these posts (one of them mine over on O'Reilly's Ruby blog and the other from Ralph Johnson, one of the fathers of Patterns) about the same topic:
Thanks for the links. By the time I read your post, I had already read Johnson's blog. I also found Mark Dominus' response. I think this is a really interesting discussion and would love to see it fleshed out more. I look forward to the feedback you get on your blog. Unfortunately, I don't have anything profound to add.
Let me add another take on it. I recently interviewed Robert Glass and asked him for his take on MJD's article. He said:
I don't see languages as the be-all end-all. But I have to admit this is a new thought to me, and my reaction is kind of off-the-cuff. I guess my strongest belief, given that, is that patterns are about design, not programming per se, and therefore it's not clear to me that patterns should be
built into programming languages. If I were to voice an opinion about what sh
ould be happening in programming languages, it would be to build in more domai
n-specific stuff to solve particular classes of problems, the result being dom
ain-specific languages. Most patterns to date are domain-independent (that's
meant as a criticism), which means that incorporating patterns into languages
does nothing to further domain-specificity.
. . .Certainly, he's right in that subroutines, which date back into the 19
50s and into assembly language, eventually were embedded in programming langua
ges. Whether that's evidence that other patterns should be similarly embedded
, I don't know.
I'm not sure if Bob really disagreed, or if it's the same opinion from a different perspective.
The language centric view is interesting, but clearly not the only way to think about these things.
I've also heard words to the effect that "the Operating System contains everything you left out of the language." I don't recall where I first heard it, it was likely at CMU or MIT, or maybe one of the X technical conferences in Boston.
my name is hoang tuan hai
i am from VN
|John "Z-Bo" Zabroski
IMHO, Design Patterns are not necessarily signs of weakness in programming languages.
I can see how some patterns might be more painful in one language than another. Scott Meyers wrote two books about how not to hang yourself in C++.
On the other hand, Bug Patterns are certainly signs of weakness in programming languages! Eric Allen's Bug Patterns in Java is basically a presentation on how not to hang yourself while writing Java code.
A good programming language should make the implementation of a particular pattern as robust as possible. After all, lest we forget patterns are not cookie cutter concepts.
Humans recognize Patterns easily, sometimes this can even lead to problems, but in general a pattern makes life EASIER for a human being.
Do you think Assembler has any pattern?
Some humans recognize pattersn in them!
For me, assembler code looks always ugly, but I feel one important thing in the patterns of higher language: beauty! (Others might say its cleaniness or similar, for me its beauty)
"Design Patterns are a sign of weakness in a language" -- I believe this should be attributed to Ralph Johnson of the "Gang of Four." I was hanging out Smalltalk Solutions when he came out with this. I'm not 100% sure he came up with it, but he said it before even the word "blog" was coined.