[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why tail recursion matters and why Java isn't it, was Re: lispperformance was Re: problems with lisp

Matthias Felleisen wrote:
> On Wednesday, September 3, 2003, at 01:11 AM, Peter Seibel wrote:
>> What's unnatural about looping? If I find certain algorithms easier to
>> think of in terms of a loop (do this, do that, then go back to the
>> beginning unless I'm done) what does that mean? That I'm a programming
>> illiterate? That I'm *really* thinking in terms of recursion but don't
>> know it because I've somehow trained my brain to unnaturally translate
>> my Platonic recursive ideas into an "iterative" form before they reach
>> my consciousness?
> To understand how program design truly works, you need to go "pure".

"Purity" is an aesthetic category. In your example, you have purity as a 
premise (a minimal set of language features) and purity as result (a 
program that behaves in a "pure" way). If you think that purity is 
beautiful, it's no wonder that you like both the premise and the result.

However, there are other possible aesthetic categories. For example, you 
might believe that programs are beautiful whose sources are expressed in 
terms that are close to the concepts of the problem domain. Many problem 
domains are not "pure", so a "mulit-paradigm" approach might be the most 
beautiful solution to approach a particular problem. For people who view 
the world from that perspective, a "non-pure" language is much more 
attractive. Again, in analogy to my above statement, if they have 
diversity as a premise and diversity as a result, it's no wonder that 
they like both the premise and the result.

It's important to note two things here:

+ Aesthetics are important. A beautiful program is easier to maintain 
and debug and so forth.

+ Aesthetics are a matter of taste. I don't think you can really argue 
for one or another aesthetic category. You either believe in one or another.

So to recap, it seems to me that you believe in purity whereas I believe 
in diversity. (One effect of this might be that I might have portrayed 
diversity in a more favorable light than purity - I hope you bear with 
me. ;)


Pascal Costanza               University of Bonn
mailto:costanza@web.de        Institute of Computer Science III
http://www.pascalcostanza.de  Römerstr. 164, D-53117 Bonn (Germany)