DEV Community

Albert Ulysses
Albert Ulysses

Posted on

Functional Programming in Python - Book Review

The Book:

Functional Programming In Python By Martin McBride

Short Summary:

"Functional Programming in Python" is a short book on writing code and solving problems using Python in a Functional Programming(FP) idiom. The first chapter goes over the three main paradigms - procedure programming, object-oriented programming, and FP. After the first chapter, we get into FP Fundamentals and how to express them in Python. The longer middle chapters go deep into iterators and iterables. The book ends with several chapters that dive into FP ideas that don't necessarily apply to Python.

What I liked:

There were several things I liked about how the author wrote the book. First, I like how the chapters are formatted. It is nice to know that the last chapters aren't necessary for Python but interesting nonetheless. I also enjoyed how the author explained the concepts. I feel as if I can implement these ideas reasonably soon. It was a good weekend book that didn't need a lot of focus to understand.

What I disliked:

I didn't dislike much about the book. If there was one thing that I would comment on, it was on the chapters about iterator functions. I'm not sure what the thought process is to give so much space to explain the different functions, and it didn't make a clear connection to FP. Perhaps my comprehension is lacking, but I had a hard time connecting the two.

Review round-up:

I would suggest any intermediate Python developer interested in exploring FP concepts in Python read this book. It's not a beginner book, nor do I think anyone with solid FP knowledge would gain much out of reading it.

Rating:

7/10 Python Snakes

Top comments (2)

Collapse
 
gdenn profile image
Dennis Groß (he/him)

I am not so sure how much of Python is really functional.

Ad hoc I can only think about lambda functions, every other language construct seems to be not purely functional because it can have side effects.

Do I get the idea wrong and miss on a lot of good content here? :)

Collapse
 
albertulysses profile image
Albert Ulysses • Edited

Hey Dennis, I don't think it's functional either per se, but it does bring into light a few different ways that you can think of your code. When thinking of multiprocessing and lazy eval, Functional programming is a helpful paradigm to think of problems.
I also think that Functional paradigms helps with some abstractions problems.