Jump to ratings and reviews
Rate this book

Functional Programming in PHP: a php[architect] guide

Rate this book
Many programming languages have embraced Functional Programming paradigms to augment the tools available. It also facilitates writing code that is easier to understand, easier to test, and able to take advantage of parallelization. PHP introduced anonymous function and closures in 5.3, providing a more succinct way to tackle common problems. However, making the leap from the more common imperative style requires understanding how and when to best use lambdas, closures, recursion, and more. Functional Programming will show you how to leverage these new language features by understanding functional programming principles. Plenty of examples are provided to illustrate each concept as it's introduced and to show how to implement it with PHP. You'll learn how to use map/reduce, currying, composition, and more. You'll see what external libraries are available and new language features are proposed to extend PHP's functional programming capabilities.

122 pages, Paperback

Published April 1, 2014

20 people want to read

About the author

Simon Holywell

1 book1 follower

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
6 (40%)
4 stars
3 (20%)
3 stars
4 (26%)
2 stars
0 (0%)
1 star
2 (13%)
Displaying 1 of 1 review
Profile Image for Stefan Kanev.
125 reviews235 followers
September 22, 2014
This was not a good book to read.

The book tries to talk about many things, but the level of detail it goes into each is comparable to a brief blog post on the subject. The code examples are full of awkwardly named variables and functions and would have been hard to follow even without all the functional stuff in the code. And speaking of that, the books spends about a third of its pages on practical stuff (map, filter, reduce, lambda functions, closures) and then goes into Haskell mumbo-jumbo: it introduces functors and applicatives for no apparent reason and than "hey, that's some cool stuff". After that, it turns into a yet another monad tutorial. After you have encountered various mathematical abstractions that really only make sense in the context of a powerful type system, you're left with a brief introduction in the world of events (as in libevent), asyncs and promises. Why? I'm not entirely sure, but I assume that the presence of anonymous functions in those three concepts qualifies them as functional.

Two bonus features that justify a 1 of 5 star review:

* It uses the term "head recursion" to mean "non-tail recursion". As if that's a real thing.

* The author has reviewed his book on Goodreads as 5/5, which would have been somewhat fine, but his only other review is of "The C Programming Language" by Kernighan & Ritchie and he gave it 4/5. Not very objective.
Displaying 1 of 1 review

Can't find what you're looking for?

Get help and learn more about the design.