LAMBDA IS IT USELESS?

John W. Baxter jwbaxter at spamcop.com
Fri Jul 13 11:08:02 EDT 2001


In article <tO837.679712$166.14009323 at news1.rdc1.bc.home.com>, EricIDLE
<grayson-wilson at home.com> wrote:

[Questions about lambda omitted]

I see assertions in this thread that "lambda is easier" and that
"lambda is harder"  (mostly that something else is easier, actually).

That's a matter of background and experience.  If one's prior
experience included routine use of lambda, then for many things "lambda
is easier."  Lambda seems to be "harder" if one has not previously been
"forced" to comprehend it.

And if one has little or no background, the most important factor is
probably the experience of one's mentor(s).  Unfortunately, if one's
mentor is this list/newsgroup, one gets mentoring that says "here, use
lambda like this...it's easy" side by side with "avoid that horrible
lambda thing if you possibly can and here's an alternative".  Or 6 or 7
alternatives which fit the habits of various people.

As with most things, the extremes are likely wrong, and success likely
lies somewhere in the middle.

One note:  it's very hard to decide wisely whether to use lambda in a
particular situation if one is unfamiliar or uncomfortable with it. 
I'd recommend learning to be comfortable with lambda...if you then
decide to put it on the shelf and use alternatives, that's fine. 
Lambda will still be sitting there ready to work for you.

Another note:  relative efficiency only matters if it matters.  If I
waste a millisecond 100 times over the course of an hour, who cares.

   --John



More information about the Python-list mailing list