Go to content

Adam Wathan - Curing the common loop

Trying to understand a complex function full of nested loops and conditionals is like trying to read a "choose your own adventure" book from front to back. In this whirlwind tour of programming with collection pipelines, you'll learn how to use functional programming ideas to break down complex code and abstract hidden duplication behind expressive higher order functions. By leveraging the power of Laravel's Collection class, we'll refactor ugly, complicated spaghetti into a series of simple, elegant transformations, free of loops, complex conditionals, and temporary variables. Never write another loop again.

August 23, 2016