[Python-ideas] Does jargon make learning more difficult?
David Mertz
mertz at gnosis.cx
Wed Aug 22 13:44:26 EDT 2018
This isn't trying to snipe. I have written the exact same unnecessary
circumlocution in my own code hundreds of times. Hopefully most of them
simplified before release, but I'm sure not all. And I "wrote the book", as
one says, _Functional Programming in Python_.
Functions as sounds is a powerful but counterintuitive concept.
On Wed, Aug 22, 2018, 1:38 PM David Mertz <mertz at gnosis.cx> wrote:
> On Wed, Aug 22, 2018, 12:40 PM Steven D'Aprano <steve at pearwood.info>
> wrote:
>
>> I believe that many people have a lot of trouble grasping the concept of
>> functions as first-class values capable of being passed to other functions
>> as data... It took me a long time to stop writing code like this:
>>
>> map(lambda x: len(x), sequence)
>>
>> instead of simply map(len, sequence).
>>
>
> That long time is ongoing :-)
>
> You recently wrote in another thread:
>
> widget.register(callback=lambda: spam.eggs())
>
> Instead of the slightly faster and definitely more direct:
>
> widget.register(callback=spam.eggs())
>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180822/364753b4/attachment.html>
More information about the Python-ideas
mailing list