r/Python • • Sep 29 '16

O'Reilly offers "Functional Programming in Python" by David Mertz as free eBook.

http://www.oreilly.com/programming/free/functional-programming-python.csp?cmp=em-prog-free-na-lgen_safari_20160929
847 Upvotes

69 comments sorted by

View all comments

5

u/penguinland Sep 30 '16

Eh... I know I shouldn't complain about free stuff, but so far I'm not impressed. I'm a little over halfway through, and it seems like a lot of the book so far could be summarized as "here's how to make your code more functional if you really wanted to do that, but these idioms are inefficient, unwieldy or otherwise unPythonic and shouldn't be used in practice."

I'll probably read the whole thing, but so far don't anticipate recommending this to my coworkers.

3

u/[deleted] Sep 30 '16 edited Sep 30 '16

I read this back when it came out, and if I remember correctly, the author even says something to that effect. You can pick and choose from the examples he gives to see if there is anything that is more efficient/clearer in a particular instance, but I believe that he admits that most of the book is about shoehorning the concepts of functional programming into Python syntax. Honestly, set/dict/list/generator expressions and their use of set builder notation is plenty functional for me. I do not usually use the constructs like map, filter and reduce unless there is a strong case to be made for doing so.