3 ms·
(2015) Btw while this code doesn't win a prize, I agree with the author that functional style is worth it in many cases, even for a language as wordy and cumbe
by skrebbel 2y ago
(2015)
Btw while this code doesn't win a prize, I agree with the author that functional style is worth it in many cases, even for a language as wordy and cumbersome as PHP. I still love PHP - its deployment story is still unparalleled and its standard library came batteries included since forever.
- ec109685 2y agophp with lambdas eliminates a bunch of the syntax and can let map/reduce style code be colocated while still achieving the functional style benefits. A big issue though (at least for some apps), is there is no attempt to make that code parallelized for the io parts. So if you aren’t careful, you can end up with n+1 style IO calls, making things very slow.
- skrebbel 2y agoPersonally I consider that a benefit at least as often as not. In Nystromian terms, PHP functions are colorless, and that removes a whole kind of complexity (at the cost of, like you correctly point out, potential performance problems).