Functional Programming and python

Franck Ditter nobody at nowhere.org
Mon Sep 30 13:04:32 EDT 2013


In article <ba94102b-18b6-4850-ac85-032b0fe2fa75 at googlegroups.com>,
 rusi <rustompmody at gmail.com> wrote:

> Combining your two questions -- Recently:
> What minimum should a person know before saying "I know Python"
> 
> And earlier this
> On Sunday, August 4, 2013 10:00:35 PM UTC+5:30, Aseem Bansal wrote:
> > If there is an issue in place for improving the lambda forms then that's 
> > good. I wanted a link about functional programming because it is mentioned as 
> > if it were a household word.
> 
> Python is not a functional programming language; however it supports most of FP better than traditional languages like C/Java.
> eg with iterators/generators + itertools + functools you can do most of what lazy lists give in haskell
> 
> Some discussion here: http://stackoverflow.com/questions/1017621/why-isnt-python-very-good-for-functional-programming
> 
> [Not everything said there is correct; eg python supports currying better than haskell which is surprising considering that Haskell's surname is Curry!]
> 
> So if I may break your question into two: 
> 1. Why should a programmer of a non-FP language know FP?
> 2. What in FP should a (any|all) programmer know?
> 
> I touched upon these in two blog-posts:
> 1. http://blog.languager.org/2013/06/functional-programming-invades.html
> 2. http://blog.languager.org/2012/10/functional-programming-lost-booty.html
> 
> Also most programmers without an FP background have a poor appreciation of the centrality of recursion in CS; see
> http://blog.languager.org/2012/05/recursion-pervasive-in-cs.html

Good approach of FP in Python, but two points make me crazy :
1. Tail recursion is not optimized. We are in 2013, why ? This is known technology (since 1960).
And don't answer with "good programmers don't use recursion", this is bullshit.
2. Lambda-expression body is limited to one expression. Why ?
Why the hell those limitations ? In this aspect, Javascript has a cooler approach.

   franck



More information about the Python-list mailing list