I sing the praises of lambda, my friend and savior!

Jeff Shannon jeff at ccvcorp.com
Thu Oct 14 01:38:35 CEST 2004


Clark C. Evans wrote:

>On Wed, Oct 13, 2004 at 10:58:14AM -0700, Jeff Shannon wrote:
>| Antoon Pardon wrote:
>| >I find it better to let the coder decide what makes sense in his program
>| >and what not.
>| 
>| Which is the Perl philosophy.  Many people seem quite happy with Perl 
>| because of this TMTOWTDI attitude; personally, I prefer Python's clarity 
>| and simplicity.
>
>On this list, that's damn near close to an ad hominem attack.
>  
>

Only if you choose to read it that way.  I pointed out that many people 
are happy with Perl, thus implying that the philosophy behind 
programming languages is largely a matter of taste.  It makes sense to 
choose a language whose design philosophy matches one's own.  From this 
and other previous discussions, it seems to me that Antoon Pardon has a 
number of disagreements with Python's design goals; that's fine, he's 
certainly entitled to his opinion, but there are others who *do* agree 
with Python's design goals.  ISTM that it would therefore be better, 
overall, for those who disagree with Pythonic philosophy to look for a 
different language that suits them better, and those who agree with 
Pythonic philosophy to keep using Python.  Trying to please everyone 
with a single language just isn't gonna work, nor should it be expected 
to.  Pointing this fact out has nothing to do with my personal opinions 
about Mr. Pardon, you, or anyone else.

>Your arguments thus far have been "I don't use it, thus it probably
>isn't useful, and therefore, no one should be able to use it."  It's
>an uninformed position and frankly, not very helpful.  
>  
>

No, my arguments thus far have been that, for almost every use for which 
lambdas are beneficial, there's another approach that is more consistent 
with core Pythonic philosophy that works almost as well or better.  
There's lots of things that I don't use but that I think are extremely 
useful (metaclasses, for instance).  Heck, I find metaclasses even more 
confusing than lambdas.... but I can also see that the *benefit* of 
metaclasses is greater, and is extremely difficult to match in more 
traditional Python.

I have tried to be clear that I'm not the most experienced or talented 
developer ever; I'm a journeyman at best, and I know it, and I'm 
perfectly willing to learn from others when the benefit of their 
teaching is clear.  But so far, the examples that I've been given for 
when lambda is useful are limited to "a programming style that uses CPS, 
deferred execution, or similar mechanism with heavy callbacks or passing 
functions," which may be something that you do a lot of but still sounds 
like a special case to me.  And even within that style, alternate 
solutions can provide most of the benefits that lambda does.

Oh, and I almost agree with you about list comprehensions -- they'd do 
just as well to be left out of Py3K, because they've been superseded by 
generator comprehensions. ;)

Jeff Shannon
Technician/Programmer
Credit International




More information about the Python-list mailing list