Introduction to Pragmatic Functional PHP

bbujisic

Functional programming is a paradigm with origins in lambda calculus and the 1930's. Stack Overflow's developer surveys from both 2017 and 2018 show that the languages optimized for functional programming are low in popularity. However, the same survey recognizes that developers actually working in Elixir, Clojure, F#, and Haskell, actually love their languages much more than PHP or C developers.

The good news is that it can be applied in a popular language like PHP. Whilst the bad news is that PHP might not be really optimized for functional programming, we already have pretty nice libraries of functional primitives for PHP. Accepting functional programming style promises to help PHP developers develop a bit cleaner or more interesting code. Functional programming also promises easier parallelization and drastically reduces the risk of the race conditions in asynchronous programming. Finally, it will make it a whole lot easier to pick up a purely functional language (Hello, Haskell!) or make use of serverless architectures such as AWS Lambda.

However, functional programming comes with some powerful but odd concepts, such as monads or the Y-combinator, which, if applied in PHP code, may result in complex, unreadable and funny-looking code. This session will dedicate some attention to them, too.

The target audience for the session would be juniors or students interested in learning about the logic behind the decision which approach or language to choose to solve a problem. It would also be informational and fun for experienced PHP developers, especially if they consider switching to a functional language for a project.

Program tags

architecture, beyond drupal, php

Experience Level

Beginner

Drupal Version