Weiqi Gao <weiqi...@a.crl.com> writes: > The fundamental doubt I have for patterns is this: If Big Shot Mohoney > tells everybody the "Combobox" pattern (imagine your self in a > pre-combobox era) is an appropriate solution to such-and-such problem in > such-and-such situation, how do I know if his teaching is GOOD?
Antonio Leitao <a...@gia.ist.utl.pt> writes: > For me, abstractions are extremely usefull, but as the number of > abstractions grows it becomes harder and harder to remember all of > them. Sometimes, it's preferable to have just a dozen of easily > understood and combinable abstractions than to have undreds of them > very hard to remember. As long as I can write simple combinations > of these abstractions, I do not jump into defining more and more > abstractions.
You don't have to remember all the functions and macros. Back to Gabriel's concrete example: If you want to find the first mis-match in two sequences, you might pause for a moment and reflect that this seems like a basic, commonly-arising task involving sequences. Hence, there's a fair chance that there already exists such a function in Common Lisp. You can then search for it. After you've found it the first time, you know it's there.
Remember that Gabriel's objection was that the use of MISMATCH was actually harder to read (for someone unfamiliar with the function) than the corresponding nine-line pattern. I think that's ridiculous.
* Aaron Gross <aaron+use...@bfr.co.il> | Remember that Gabriel's objection was that the use of MISMATCH was | actually harder to read (for someone unfamiliar with the function) than | the corresponding nine-line pattern. I think that's ridiculous.
I think the argument has merit. the reason is simple: if you want something to be very popular, you have to _design_ it so you know how the distribution of capabilities of your adherents is going to look. if you aim for a normal distribution and a certain number of people, you may have to avoid abstractions because there aren't that many people who are able to deal with them. patterns, however, fit much better with how people who are weak at abstractions work: cut and paste, modify example code, and "reuse" through random proliferation.
in many ways, modern language design is an attempt to solve the problem of how to avoid serious damage by the average programmers. we can't rely on good programmers, anymore, so the people who become programmers for the money they need to pay for normal family life expenditures like wife, kids, house, cars, etc, quite unlike the dedicated programmers of times past, have very different _real_ interests and are unlikely to get really involved in their work, just like most other average people are much more interested in beer and sports than their work.
another argument is that abstraction is something you get used to through very hard training, and if you don't get used to it, you won't be able to pick it up at random, either. I don't know exactly how some people get better at abstractions than others, but I have no problem understanding that some forms of abstractions may require immersion into a field for a very long time, but maybe it's more than immersion, and maybe it isn't.
if it is just a matter of immersion and exposing people to more abstract ways of thinking so they get used to it, removing abstractions from out of reach of average people is doing them a fundamental disservice and patterns is a sure-fire way of never improving the lot of mankind. if there is some genetic quality to abstractions (I don't believe there is) that makes only a small portion of the population able to deal with them successfully, then patterns is a very good solution to having overreached the capacity of the human brain.
that is, given the current tendency to view people are unchangeable and more or less genetically predetermined, "patterns" emerges as a solution to the problem of the failure of abstraction to get hold in the masses of people who want to write software for money, but the core argument is at fault: people are able to learn abstraction if they have to and get used to it: expose them to it, and they get it in time. if they can run away, however, most will. letting them run away is no good solution to the fundamental problem of programming in society: we need responsible people who don't make stupid mistakes in critical software that is already far too complex for the human mind to understand in its entirety.
I don't think the answer to the core problems can be anything but giving people more abstract tools and better tools for abstraction. I don't think patterns is anything but a serious deterrent to learn abstraction -- mostly because the variation between applications is supposed to be more important than the similarities, which only means that people are muddling the issues -- and gain popularity out of a form of despair: we can't educate people fast enough, and young people just make too much money before they have graduated, or at least hope they can, so we have to design something that such people can deal with at their abstraction levels.
where's Lisp in all of this? I'll repeat something I said at LUGM'99: "Common Lisp is a language you graduate into." I think people will find Lisp suitable after they crave something better than they have been bored of repeating. consider the programmer who realizes "why keep repeating this nine-line code fragment all over the place when the function is much easily expressed as a MISMATCH function call?" -- that's the kind we want to graduate into Common Lisp. but this won't happen if patterns is the best solution they can think of, or they don't realize that patterns are intended to keep people who can't handle power tools from hurting people.
put another way: patterns emerge from people solving problems over and over in better and better ways. abstractions emerge from patterns when the confusion of elements in the patterns are isolated and crystallized. familiarity with patterns is necessary to forming abstractions, but the focus on patterns means that people are allowed to _stay_ confused.
* Antonio Leitao wrote: > I wouldn't consider the first version "extremely inefficient". In > fact, the mapcar should be dominant and the difference should be > minimal. A small experience shows us that the results are quite the > opposite of the expected. > [...]
(with-cynicism
That's because the example has been carefully chosen so that on typical lisps it doesn't matter which one you do since the consing because of MAPCAR (and the function call overhead on each list element) is completely dominant in most implementations. So the unwary will be trapped into thinking that you just don't need to care.
In real life things are more complex. You need to know if there is a performance issue, for instance, and both avoid the C-programmer's case of optimizing / abstracting some thing that maps over lists which never have more than 3 elements, and only gets called at macro-expansion time anyway, and the lisp-programmer's case of doing your numerically-intensive array bashing code with arrays represented as lists, and dying horribly that way.
> patterns, however, fit much better with how > people who are weak at abstractions work: cut and paste, modify example > code, and "reuse" through random proliferation.
[snip]
> if it is just a matter of immersion and exposing people to more abstract > ways of thinking so they get used to it, removing abstractions from out > of reach of average people is doing them a fundamental disservice and > patterns is a sure-fire way of never improving the lot of mankind. if > there is some genetic quality to abstractions (I don't believe there is) > that makes only a small portion of the population able to deal with them > successfully, then patterns is a very good solution to having overreached > the capacity of the human brain.
I disagree with your premise. You can't cut and paste patterns. Even though in "typical" languages such as C++ and Java it is common that their _implementations_ can be cut and pasted. So, in these languages patterns are there for wont of a better abstraction.
This notwithstanding, patterns do help abstraction. The abstraction is not expressible in the code itself, but it can be identified and documented. Before the advent of explicitly codified patterns these abstractions would most of the time have gone unnoticed! In this way, patterns pull the level of discourse toward more abstraction. This conclusion may not apply to the Lisp programming community, but it fits the C++ and Java communities very well (I can't tell for Smalltalk).
* Michael Schuerig | I disagree with your premise. You can't cut and paste patterns.
huh? I'm saying that people who aren't very good at abstraction write _code_ using cut-and-paste techniques and that patterns fit this mode. this is obviously different from cutting and pasting "patterns", which I find to be a nonsensical statement -- it's like saying that you can't copy somebody's idea because Xerox machines don't work that way.
| This notwithstanding, patterns do help abstraction. The abstraction is | not expressible in the code itself, but it can be identified and | documented. Before the advent of explicitly codified patterns these | abstractions would most of the time have gone unnoticed! In this way, | patterns pull the level of discourse toward more abstraction. This | conclusion may not apply to the Lisp programming community, but it fits | the C++ and Java communities very well (I can't tell for Smalltalk).
I think you might want to read my article again, since this doesn't seem as if you're doing anything but try to re-phrase what I said in a light somewhat more favorable to patterns.
incidentally, I'm strongly ambivalent on patterns. I hate them if they are used to destroy our ability to solve problems once and for all without the need for the repetitiveness of reimplementing them verbosely all the time, and that is a recurring argument in their _favor_ by people who think that most complex problems don't actually _have_ solutions. I love them if they are used to keep people who can't write good code from writing really bad code. ideally, we should get rid of the people who can't write good code, and thus raise the average and our concept of what "can't write good code" means, then keep doing this iteratively until programming became a serious profession with social responsibility.
* Aaron Gross <aaron+use...@bfr.co.il> | A curse on the programmer who first picked up a Christopher Alexander | book! Great for buildings, horrible for software.
an amusing epitaph! I wish I had written this myself, as I quite I agree that Christopher Alexander's work is amazingly interesting for the field in which he thought it up, but I, too, fail to see how it applies to the way software is built. this doesn't mean we don't need to figure out how we come by our abstractions, and maybe it progresses through stages that, if not viewed as stages, could be very close to architectural patterns.
this is getting vague, but my impression here is that somebody has seen something and have grappled for a name and not found one. then there's this quality without a name, but the only thing that really matches up with the software people's grappling for a name is the lack of a name. two things both lacking a name aren't commonly thought to be the same, but that's how I think the misapplication of patterns to software was born. nonetheless, it's very interesting to have seen it expanded upon and we're the richer for having had some work in this area, but let's figure out why we didn't really win this time, either, and move on.
Erik Naggum <e...@naggum.no> wrote: > * Michael Schuerig > | I disagree with your premise. You can't cut and paste patterns.
> huh? I'm saying that people who aren't very good at abstraction write > _code_ using cut-and-paste techniques and that patterns fit this mode.
Okay. I agree with the first part, I don't agree with the second. Patterns *taken seriously* don't facilitate cut-and-paste programming. Although this may happen, if they're not taken seriously and used just for the hype ("Now paste some Factory here...").
I took you to rely on the premise that patterns hinder abstraction. But our misunderstanding may be caused by two very different points of view (see below).
> | This notwithstanding, patterns do help abstraction. The abstraction is > | not expressible in the code itself, but it can be identified and > | documented. Before the advent of explicitly codified patterns these > | abstractions would most of the time have gone unnoticed! In this way, > | patterns pull the level of discourse toward more abstraction. This > | conclusion may not apply to the Lisp programming community, but it fits > | the C++ and Java communities very well (I can't tell for Smalltalk).
> I think you might want to read my article again, since this doesn't seem > as if you're doing anything but try to re-phrase what I said in a light > somewhat more favorable to patterns.
Let's see if I can sort out how we approach this. In my opinion, the extra bit of abstractions that patterns provide is well worth it, because it actually lifts the level of abstraction most software developers can cope with (at least the ones I usually meet in real life -- a very different place from usenet). For this benefit I tend to accept the detrimental effect of "canned abstractions" that keep people from growing their own abstractions. Now, if I understand you correctly, it's exactly this effect that you deplore.
> incidentally, I'm strongly ambivalent on patterns. I hate them if they > are used to destroy our ability to solve problems once and for all > without the need for the repetitiveness of reimplementing them verbosely > all the time, and that is a recurring argument in their _favor_ by people > who think that most complex problems don't actually _have_ solutions. I > love them if they are used to keep people who can't write good code from > writing really bad code. ideally, we should get rid of the people who > can't write good code, and thus raise the average and our concept of what > "can't write good code" means, then keep doing this iteratively until > programming became a serious profession with social responsibility.
So we seem to agree.
In favor of patterns I'd like to add that their introduction into software has spawned a whole lot of interesting discussions among highly skilled software developers. In my opinion this is very valuable.
> But apparently these patterns can't be made explicit, or at least aren't yet.
What do you mean by explicit? Is this not explicit because I can't tell you over usenet? Or because I would ask you to take a course of training involving discussion, reflection and and practice?
> > > Interestingly, things are different regarding software. We have computer > > > science that deals among other things with properties of programs. And > > > we have an aspiring engineering disciplin...
> > I think that although CS is an aspiring engineering discipline it has a > > long way to go.
> That's what makes it "aspiring"...
When does aspiring become actual? At the present rates of progress I would expect CS to mature into an engineering discipline some time around 2249... ;)
> > Yes, there is a difference between maths teaching and software > > development. However, I am less certain about the differences between this > > and maths research. Any problem solving or research activities encompasses > > similar techniques, and these techiniques can (should?) be called > > patterns.
> And it would be nice if the people involved made those patterns explicit.
Yes it would. But this is not be possible.
<digression> There is a story told about Ludwig Wittgenstein. He had dedicate some number of years to writing a book called the Tractatus, describing everything that could be said. He then gave this book to a friend, an Italian philosopher whose name escapes me, to read. On having read the manuscript, Wittgenstein challenged his friend to tell him something that wasn't in the book. His friend shrugged his shoulders, and in a state of anguish Wittgenstein through the book in the bin. </digression>
Finally, there are lots more things in the world that would be `nicer' that this...
schue...@acm.org (Michael Schuerig) writes: > Tim Bradshaw <t...@tfeb.org> wrote: > > But now there's a problem. If you can formalise the description of > > some proposed `pattern', then you can invent a language which talks > > about it directly -- because programming languages really just *are* > > formal descriptions of things. And of course Lisp is the language > > you'd do that in because Lisp is kind of about this metalinguistic > > stuff in some sense.
> Here you are more or less talking about idioms.
Why? What's the problem? You take something that's regarded as a pattern and provide direct suppport for in a language. How does it end up being an idiom? Or is the idea that you cannot provide such direct support for patterns but only for things that weren't really patterns in the first place?
> > But if you can have it directly in some language then it isn't a > > pattern (they say).
> You can't really have a pattern directly in the language. The language > itself does not tell you when to use whatever cool feature it > provides. A pattern describing its application can. It's just that the > implementation of some of those patterns is ridiculously easy in some > languages.
Well, I think it's reasonably clear what Tim has in mind, and hence to understand the idea of having a pattern directly in the language.
Norvig provides an example. He says subroutine call used to be a pattern (in assembler, say). Yet now subroutine call clearly is built into languages. Now, it seems to me that Michael Schuerig has to disagree with Norvig here and say that it never was a pattern or else deny the obvious fact that subroutine call is built into languages.
I suspect that the way out will be to say the *pattern* has not been build into languages. It's just that now there's something in languages that makes the pattern ridiculously easy.
But that would just be a translation of what Tim was saying into official pattern-speak (we might call it), rather than a disagreement with what he was saying.
hrumm...@cc.hut.fi wrote: > For the record, I have only a passing familiarity with either software > patterns or the study of mathematical problem solving, but that never > stopped anyone on Usenet did it?
I agree. I find complete knowing something about what you are talking about is a major hinderance to heated debate ;)
> [programmer deprived of using multi-methods] > > But then they start reading the patterns literature and discover that > > it's actually the visitor pattern.
> > My view is that they ought to feel a bit happier about what they've > > been doing at that point, because the seeming kludge is actually > > thought to be a reasonably good way of doing things.
The problem I have with this discussion is that my point was basically what's in the paragraph just above, and your claim about experts was posted as if it somehow showed I was wrong. And your remark does *seem* to be a disageement.
You say all you meant was "That experts do something is neither a necessary nor a sufficient condition for it to be a pattern". But that means you can't go from "X is a pattern" to "experts do X" (because the latter is not a necessary condition of the former).
But that immediately raises the question "if experts don't do X, what do they do instead?" And example of an X of the sort I had in mind would be using the visitor pattern in certain specifiable circumstances which happened to obtain in the case my example programmer was considering.
Of course, there could be patterns that aren't used by experts, but only (for instance) by novice programmers (for some reason). I'm not trying to suggest that use-by-experts is somehow built into the definition of "pattern". I nonetheless continue to feel that programmers using certain somewhat awkward languages, such as Java, will find patterns helpful in (a) finding some thought-to-be- good but not all that obvious ways to do things, and (b) reassuring them that a way they've worked out is not as bad as it looked -- and that this is less so in certain other languages.
> > > > Humm. A lot of patterns seem of similar generality to me.
> > > Then just rename then internally to idioms and, if necessary, keep outer > > > appearance up.
> > Why would I want to rename them? I have no objection to calling them > > patterns, or to thinking of them as patterns.
> Well, then you may have to accept that other people divide your class of > patterns still further.
But there will always be subkinds of patterns, in any case.
There's a general problem here. In this discussion of patterns, some people (in fact, most of them) seem to be using "pattern" in pretty much it's usual sense. So we might notice a certain regularity in how certain things were done -- ie, a pattern -- and call it "a pattern". And some such patterns can certainly be "packaged up" and embodied in a programming language (or added to one via macros etc). Mapcar is an example, and there are many, many others.
(Of course, when we write such things up as patterns, we add something about when to use them and so on. And then perhaps sometimes "the pattern" will be meant to include this information about conditions, etc, and sometimes not; hence, no doubt, much confusion.)
But some people -- you, for instance -- *seem* to be using "pattern" in some other, presumably more technical, sense. So some things that are patterns in the ordinary sense of the word are not technically patterns at all, but something else, such as idioms.
Moreover, in this view even the GOF book has this wrong and calls some things patterns when they're not, even though "pattern" ramains very general. I just don't see the point of excluding these things from counting as patterns. Or, rather, I don't see any good point to doing it.
> > (BTW, where Gabriel has complained that the Gang of Four book has > > too narrow a notion of patterns, you seem to think its notion is > > too broad, that it includes things that are not patterns at all, > > but instead idioms. For whatever reason, I find Gabriel's view > > much easier to understand.)
> Actually, I agree with Gabriel. The GOF-book is very narrowly tied to > pretty low-level patterns, that in some cases are below my pattern > threshold. This doesn't make it a bad book in any way, of course. But it > set an unfortunate precedent as this thread is constantly showing. The > patterns in that book aren't paradigmatic patterns, but they're often > seen that way.
Ther question here has been whether the patterns in the book are patterns at all, not whether they're paradigmatic.
> It would be interesting to hear what exactly happened at the GOF show > trial at this year's OOPSLA.
> Jeff Dalton <j...@todday.aiai.ed.ac.uk> writes: > > > BTW, what do you think of "Value + Quantity"? There you don't carry > > > around plain values, but their units as well. It's some kind of > > > home-made manifest typing. I'd be surprised if something like this is > > > not used in the Lisp community. > > Probably. I think there was a version of Scheme used for something > > related to (I think) SGML that had values with units. > The language you're probably thinking of is DSSSL, the ISO standard > SGML transformation and "style-sheet" language.
William Deakin <wi...@pindar.com> wrote: > Michael Schuerig wrote: > > But apparently these patterns can't be made explicit, or at least aren't > > yet.
> What do you mean by explicit? Is this not explicit because I can't tell > you over usenet? Or because I would ask you to take a course of training > involving discussion, reflection and and practice?
Yes to all. We may agree that the patterns are there, but apparently we can't make them explicit and have to convey them by a different means (every Wittgensteinian would hit me with the Private Language Argument now...).
> > > I think that although CS is an aspiring engineering discipline it has a > > > long way to go.
> > That's what makes it "aspiring"...
> When does aspiring become actual? At the present rates of progress I would > expect CS to mature into an engineering discipline some time around > 2249... ;)
Well, others have taken longer.
> > > Yes, there is a difference between maths teaching and software > > > development. However, I am less certain about the differences between this > > > and maths research. Any problem solving or research activities encompasses > > > similar techniques, and these techiniques can (should?) be called > > > patterns.
> > And it would be nice if the people involved made those patterns explicit.
> Yes it would. But this is not be possible.
Is there some in-principle reason for this?
> <digression> > There is a story told about Ludwig Wittgenstein. He had dedicate some > number of years to writing a book called the Tractatus, describing > everything that could be said. He then gave this book to a friend, an > Italian philosopher whose name escapes me, to read. On having read the > manuscript, Wittgenstein challenged his friend to tell him something that > wasn't in the book. His friend shrugged his shoulders, and in a state of > anguish Wittgenstein through the book in the bin. > </digression>
In the preface to the TLP, Wittgenstein himself writes
<quote> ... the truth of the thoughts that are here communicated seems to me unassailable and definitive. I therefore believe myself to have found, on all essential points, the final solution of the problems. And if I am not mistaken in this belief, then the second thing in which the of this work consists is that it shows how little is achieved when these problem are solved. </quote>
What you're saying in your previous paragraphs and postings is much closer to the views Wittgenstein espouses in his Philosophical Investigations.
Jeff Dalton <j...@todday.aiai.ed.ac.uk> wrote: > But some people -- you, for instance -- *seem* to be using "pattern" > in some other, presumably more technical, sense. So some things > that are patterns in the ordinary sense of the word are not > technically patterns at all, but something else, such as idioms.
Jeff Dalton <j...@todday.aiai.ed.ac.uk> wrote: > schue...@acm.org (Michael Schuerig) writes: > Well, I think it's reasonably clear what Tim has in mind, and hence > to understand the idea of having a pattern directly in the language.
The most important thing about a pattern is that it gives you guidance when to apply it. A language feature does not do that.
> Norvig provides an example. He says subroutine call used to be a > pattern (in assembler, say). Yet now subroutine call clearly is > built into languages. Now, it seems to me that Michael Schuerig > has to disagree with Norvig here and say that it never was a pattern > or else deny the obvious fact that subroutine call is built into > languages.
The apparatus for subroutine call itself is not a pattern. The reasoning that goes into deciding when and where to use it may well have been patternized.
> I suspect that the way out will be to say the *pattern* has not > been build into languages. It's just that now there's something > in languages that makes the pattern ridiculously easy.
Sorry, I don't consider this a debating club or something akin. I don't need a way out. I don't need to convince you or anyone. I'm fully content when I succeed in _explaining_ my position to the other discussants. And most of all I don't need adversarial arguments.
* Michael Schuerig | The most important thing about a pattern is that it gives you guidance | when to apply it. A language feature does not do that.
this whole argument is getting rather bizarre in my view. it seems that you attribute to these "patterns" the entire culture of good programming practice, and refuse to acknowledge that good programming practice can even exist without patterns. it's like the joke about Freudians: if you deny having an Oedipus complex, you're even worse off, because then you suffer from _suppressing_ your Oedipus complex. however, nobody here appears to be denying the value of patterns, just the exclusionary point that everything else that has value must also be patterns, and that if it isn't a pattern, then it lacks goodness in some fundamental sense. in this particular case, consider a textbook and a community of programmers who tell their students and new members how to use a langauge feature. some would say "ah! pattern! I knew it!" while others will argue that _teaching_ and _apprenticeship_ are hardly worth patternizing since they are already well-established processes and concepts.
I think it's worth our while to identify certain commonalities in what good programmers do when they write good software, but there is a very real danger in making everything explicit and spending time talking about it: we lose track of its proportions and relevance, and the more we talk about one thing to the exclusion of other things, the more we try to tie that thing into everything else through the most dubious of connections that would be seen as obviously wrong to anyone who had not focused so heavily on that particular thing. this is why it's vital to a healthy mind constantly to seek and examine information that runs counter to its established ideas and concepts. only that way can a person maintain the crucial psychological belief that what one does believe is superior to what one does not or no longer believe. the alternative is fanaticism.
root <e...@naggum.no> wrote: > * Michael Schuerig > | The most important thing about a pattern is that it gives you guidance > | when to apply it. A language feature does not do that.
> this whole argument is getting rather bizarre in my view. it seems that > you attribute to these "patterns" the entire culture of good programming > practice, and refuse to acknowledge that good programming practice can > even exist without patterns.
I have never explicitly refused to acknowledge that good programming practice can exist without patterns. If you think I did, please show me a case. Or just take my word that I'd be sorry to have done so in case I ever did -- which I doubt.
Obviously good programming practices must have existed before patterns were written down or else there would have been nothing to write down. There's even a "law", attributed to Frank Buschmann, that says something can only be a pattern if there are at least three independent cases of its successful use. Patterns just capture good practices in a specific form and that's almost all there is to it.
> however, nobody here > appears to be denying the value of patterns, just the exclusionary point > that everything else that has value must also be patterns, and that if it > isn't a pattern, then it lacks goodness in some fundamental sense.
Then the people "here" seem to have put up a strawman.
> I think it's worth our while to identify certain commonalities in what > good programmers do when they write good software, but there is a very > real danger in making everything explicit and spending time talking about > it: we lose track of its proportions and relevance, and the more we talk > about one thing to the exclusion of other things, the more we try to tie > that thing into everything else through the most dubious of connections > that would be seen as obviously wrong to anyone who had not focused so > heavily on that particular thing.
But we don't do this. Usually, in this group patterns aren't mentioned at all. There are other groups (not just on usenet), where patterns are very prominent. So what. I take discussing patterns to be worthwhile, even though I'm not particularly interested in some esoteric connections to zen buddhism or whatever. Of course there are other worthwhile topics for discussion -- but in my opinion it's more prudent to say that they have too little mindshare rather than that patterns have too much. Put to the point: I'm interested in patterns to exactly the extend that they help me write better software. Most of all, I'm thankful that the whole pattern movement has given me a chance to peek at the hard-won insights of other people.
I've been following this discussion for a while but must not understand the full gist of the anti-"patterns" argument. Surely, many OOP patterns "disappear" in Lisp because the language directly supports the desired functionality. Heck, many of the GoF patterns are non-issues in Smalltalk, an OO language that directly supports the desired functionality.
But it seems to me when programming in any language one encounters metalinguistic constructs that fall outside the language and thus become patterns of design or implementation. Lisp certainly supports a much higher degree of abstraction than C++, but...
Consider the situation in which a program processes mutually inductive data definitions, say,
I've seen many functional programs, written by many different programmers, create two functions in this case, one for each definition. This is opposed to, say, writing one function from scratch for handling s-lists that incorporates the symbol- expression handler within. The fact that I see this solution frequently in many different situations seems to indicate that mutual recursion is a common pattern in functional programming. There are reasons that make this solution preferable to other possible solutions, which is part of documenting something as a pattern.
Of course, I can use program derivation to fold the two functions into one, but there are trade-offs in readability and modifiability made. Again, this seems to be a pattern that reflects balancing the "forces" in a particular application.
Can we simply automate this idea in a Lisp function, making the pattern go away? I don't think so, because the solution is a design-level construct, not a function-implementation construct. It refers outside the program to the problem definition. Certainly I can create code to support application of the pattern, but then again that is what OO programmers do to support the application of, say, MVC.
I'm very interested in hearing the perspective of "expert" Lisp programmers in this discussion, because I see things like this:
: A curse on the programmer who first picked up a Christopher Alexander : book! Great for buildings, horrible for software.
... and wonder if I'm missing something. I don't see how Alexander's idea can be great for buildings and yet horrible for software. We certainly don't understand software to the level of creating formal theorems and science for writing it yet, and documenting the patterns that occur in real software seems like a pretty good way for us to try to understand better.
-- +-------------------------------------------------------------------------+ | Eugene Wallingford walli...@cs.uni.edu | | University of Northern Iowa | | Department of Computer Science | +-------------------------------------------------------------------------+ -- +-------------------------------------------------------------------------+ | Eugene Wallingford walli...@cs.uni.edu | | University of Northern Iowa | | Intelligent Systems Laboratory | +-------------------------------------------------------------------------+ -- +-------------------------------------------------------------------------+ | Eugene Wallingford walli...@cs.uni.edu | | University of Northern Iowa | | Intelligent Systems Laboratory | +-------------------------------------------------------------------------+
> I don't see how > Alexander's idea can be great for buildings and yet horrible > for software.
I is horrible because software is NOT a building. Software architecture is NOT the same thing as building architecture. It is like saying that debugging is the same as pest extermination. Analogies are good. Knowing their limits is better.
In addition, most of the work on software patterns has bastardized most of Alexander's work - look at the stark, dead functionality of GOF pattern forms with respect to the supple and - dare I say it - "living" form of Alexander's patterns. All in all, the software community has a LOT to learn from Alexander, just as it has a lot to learn from all examples of good design. But in reality, the best thing that most software engineers can learn from him is his concern for people and their lives. Look at his OOPSLA address and see how few of his core issues the GOF and the other pattern mavens expound (or see how many truly tortured analogies they make to turn his work into somethng that they can attempt to comprehend from a mechanistic viewpoint).
If you really think the aforementioned statement you made is correct, I suggest you cut latticework in your code listings (or your disk drives) because subroutines need divided light just like rooms.
Michael Schuerig wrote: > Will wrote: > > What do you mean by explicit? Is this not explicit because I can't tell > > you over usenet? Or because I would ask you to take a course of training > > involving discussion, reflection and and practice? > Yes to all. We may agree that the patterns are there, but apparently we can't make > them explicit and have to convey them by a different means
OK then. I would say there are lots of patterns that can be made explicit. But there are some in particular, to do with problem solving (say), that involve learning a process through doing and that cannot be made explicit.
<digression> This is where I would, if I had (or even owned) a copy of the Tractatus to hand, I would quote the bit at the end about pulling the ladder up after oneself ;) </digression>
However, I must be careful not to sound like the `patterns mystic' who claims that to reach true pattern enlightenment requires a restricted diet, 14-hours-a-day mediation on pattern-hood and living in a draughty galvanized-shed some where near Cader Idris. This is not what I am trying to say.
> (every Wittgensteinian would hit me with the Private Language Argument now...).
Now would I do such a thing? Don't you think Wittgenstein had a point tho' ;) Anyway, I suppose I am asking for you to be explicit in your meaning of explicit. This is because I am not sure that we are using the word in the same way. A language game perhaps? ;)
> > > ...it would be nice if the people involved made those patterns explicit. > > Yes it would. But this is not be possible. > Is there some in-principle reason for this?
I think there is. Yes. Written and spoken language is not (necessarily) up to the job of communicating these things. It is then down to other methods to try and communicate this kind of information.
This may also be to do with things like the axiom set, paradigms, or world view (what ever you want to call them) on which the communication is based. As an `communicator' I need to know where you are before I can tailor the delivery of the description of the `pattern.' For some reason this makes me think of Planck who taugh himself to swim though a reading a `teach-yourself' manual on swimming. Which may invalidate some of what I am saying. But whatever.
Alternatively, this could be because I am very bad at communicating and have never met anybody who was (much) better at this than me. It's just that I have spent some years looking for descriptions of the methods or patterns of problem solving.
> In the preface to the TLP, Wittgenstein himself writes
> <quote> > ... the truth of the thoughts that are here communicated seems to me > unassailable and definitive. I therefore believe myself to have found, > on all essential points, the final solution of the problems. And if I am > not mistaken in this belief, then the second thing in which the of this > work consists is that it shows how little is achieved when these problem > are solved. > </quote>
Thanks for the quote. I think it sums up some of the problems I see with the Tractatus :)
> What you're saying in your previous paragraphs and postings is much > closer to the views Wittgenstein espouses in his Philosophical > Investigations.
Well, I must compliment you on your perception. Of Wittgenstein's works, I like, if that is the right word, maybe this should be `am influenced' or `am interested in', Philosophical Investigations the most. This is why I own a copy of PI and not the Tratatus. I struggled through bits of Tractatus some years ago and gave it away but read and re-read Philosophical Investigations.
However, please do not take my philosophical ramblings as anything other than that of an interested member of the great-unwashed. I do not want you to think I have delusions of philosophical competence, (or adequacy for that matter) ;)
schue...@acm.org (Michael Schuerig) writes: > Let's see if I can sort out how we approach this. In my opinion, the > extra bit of abstractions that patterns provide is well worth it,
A problem with regarding patterns (used in code) as providing abstraction is that when reading the code you have to determine that it is in fact an instance of the pattern. That someone has *documented* it as such is not enough, because the doc may be out of date or just plain wrong. This is especially difficult when the pattern involves code in separate classes, files, or whatever.
That's one reason why patterns in how things are done (and there I am of course using "pattern" in its ordinary sense) are so often embodied in macros, higher-order functions, classes, or just plain procedures in Lisp. (And hence the idea, common in Lisp circles, of constructing a language within Lisp that's suited to the problems at hand.)
Then even patterns that are not so embodied become shorter and easier to recognize.
In practice, the now popular patterns approach is often counter-abstraction, because it encourages people to write things out in-line rather than building up the level at which they work by defining appropriate macros, procedures, and so on. The result is a lot of low-level, verbose code.
> > | This notwithstanding, patterns do help abstraction. The abstraction is > > | not expressible in the code itself, but it can be identified and > > | documented. Before the advent of explicitly codified patterns these > > | abstractions would most of the time have gone unnoticed!
That's an interesting claim, and I'm sure there's at least some truth to it; but I wonder what the evidence is. Most of the time? How do you know? I can think of a number of cases when patterns were identified, and even talked about using the word "pattern", before the official pattern movement even existed.
My suspicion is that one reason why "patterns" are such a big deal now is that C++ and Java programmers really need them. For instance, many things that are straightforward to do in ordinary languages become significantly more difficult in Java because they have to fit into a restrictive and rigid form of OOP.
> because it actually lifts the level of abstraction most software > developers can cope with (at least the ones I usually meet in real life > -- a very different place from usenet). For this benefit I tend to > accept the detrimental effect of "canned abstractions" that keep people > from growing their own abstractions.
"Canned" abstractions do not prevent people form growing their own. They provide higher-level constructs that make it easier for people to develop even higher-level abstractions, and they provide valuable examples.
> > Well, I think it's reasonably clear what Tim has in mind, and hence > > to understand the idea of having a pattern directly in the language.
> The most important thing about a pattern is that it gives you guidance > when to apply it. A language feature does not do that.
Sure, though it's not quite completely true. There's always some implicit guidance in the argument types or the syntax or whatever. In any case, even without that, it is reasonably clear what Tim has in mind, etc.
And given that it's reasonably clear, and that it's reasonably clear what you mean by "pattern" (see below), what's the point of disagreeing? What we have is a "merely verbal" dispute around the word "pattern".
Hence also my remark in another message:
(Of course, when we write such things [as mapcar] up as patterns, we add something about when to use them and so on. And then perhaps sometimes "the pattern" will be meant to include this information about conditions, etc, and sometimes not; hence, no doubt, much confusion.)
> > Norvig provides an example. He says subroutine call used to be a > > pattern (in assembler, say). Yet now subroutine call clearly is > > built into languages. Now, it seems to me that Michael Schuerig > > has to disagree with Norvig here and say that it never was a pattern > > or else deny the obvious fact that subroutine call is built into > > languages. > The apparatus for subroutine call itself is not a pattern. The reasoning > that goes into deciding when and where to use it may well have been > patternized. > > I suspect that the way out will be to say the *pattern* has not > > been build into languages. It's just that now there's something > > in languages that makes the pattern ridiculously easy. > Sorry, I don't consider this a debating club or something akin. I don't > need a way out. I don't need to convince you or anyone. I'm fully > content when I succeed in _explaining_ my position to the other > discussants. And most of all I don't need adversarial arguments.
You're right that we shouldn't treat the newsgroup as a debating club. On the net, it's easy to fall into adversarial ways of doing things. At least I find it so. Anyway, I don't intend any hostility to you personally.
But you did take pretty much the "way out" that I suggested. That I could anticipate that is evidence that you had succeeded in making your meaning clear.
William Deakin <wi...@pindar.com> wrote: > Michael Schuerig wrote: > <digression> This is where I would, if I had (or even owned) a copy of the > Tractatus to hand, I would quote the bit at the end about pulling the > ladder up after oneself ;) </digression>
<quote> 6.54 My propositions are elucidatory in this way: he who understands me finally recognizes them as senseless, when he has climbed out through them, on them, over them. (He must so to speak throw away the ladder, after he has climbed up on it.)
7 What we cannot speak about we must pass over in silence. </quote>
> > (every Wittgensteinian would hit me with the Private Language Argument > > now...).
> Now would I do such a thing? Don't you think Wittgenstein had a point tho' ;)
Yes, of course he has a point. And when I wear my philosopher hat I do accept the Private Language Argument (or rather the argument saying there can't be such a thing).
> However, please do not take my philosophical ramblings as anything other > than that of an interested member of the great-unwashed. I do not want you > to think I have delusions of philosophical competence, (or adequacy for > that matter) ;)
:-) Well, if I had not inadvertantly drifted into professional software development I really ought to be working on my master's thesis in philosophy. But programming is so much easier. No, actually it's not easier on the whole, but at least for me it's a lot easier to see what the next step is.