Banishing Loops with Functional Programming

David Hayes (09.Mar.2018 at 11:00, 45 min)
Talk at Midwest PHP 2018 (English - US)

Rating: 5 of 5

Do you like heavily nested loop-ridden code? Me neither! Here's the good news: your code doesn't have to be that way. Functional programming can help! In this talk we'll cover how you can banish `for` and `foreach` loops from your code by better understanding the most common and accessible functional programming concepts: `map`, `filter`, and `reduce`. We'll draw out concrete examples in PHP that will let you filter down complex data (like arrays of fetched posts) in simpler ways than you may have thought possible. We'll show practical refactorings of hard-to-follow code into better functional PHP and JavaScript. We'll also cover what functional programming is---it's more than just the "function" keyword---and how it can unlock whole new ways of thinking about the code we write.

Who are you?

Claim talk

Talk claims have been moved to the new site.

Please login to the new site to claim your talk

Comments closed.


Rating: 4 of 5

09.Mar.2018 at 11:42 by Kristen Kinnear-Ohlmann (6 comments) via Web2 LIVE

Great presentation but it was whipping by pretty fast until I pulled up the slides and followed along.

Rating: 5 of 5

09.Mar.2018 at 11:43 by Nelson Castillo (11 comments) via Web2 LIVE

Flatmap! Say what!!! I loved the whole talk!

Rating: 5 of 5

09.Mar.2018 at 11:43 by Wade Wendorf (14 comments) via Web2 LIVE

Very well done presentation. I've already seem some spots to optimize my code using this. I use the concepts a little bit, but I can see where I can make much better use of it now. Thank you!

Rating: 5 of 5

09.Mar.2018 at 12:53 by Mark J Williams (3 comments) via iPhone app

I’ll be refactoring all my code Monday

Rating: 4 of 5

09.Mar.2018 at 12:53 by Noah Bratzel (38 comments) via Web2 LIVE

I enjoyed this talk. It was a whole lot of things that I need to spend a lot more time trying out. I think it could have been more targeted towards people with no knowledge of these concepts by slowing down and covering them more slowly and thoroughly.

Rating: 4 of 5

09.Mar.2018 at 13:00 by Brian Skorseth (5 comments) via Web2 LIVE

Very useful with a fresh approach I hadn't encountered before. Would have liked a little more time to read through the code just so I could understand what the "before" and "after" were doing. Being able to access the slides on my own resolves most of that though.

Rating: 4 of 5

09.Mar.2018 at 13:11 by Brian Fenton (71 comments) via Web2 LIVE

Good info, I wish more people did this. Some useful examples & memorable phrases.

Rating: 4 of 5

09.Mar.2018 at 13:11 by Aaron Piotrowski (11 comments) via Web2 LIVE

Great talk introducing functional concepts using examples familiar to PHP developers. I think a bit more time focusing on the functional concepts than defining functions would be beneficial. Discuss defining closures with used variables, skip the rest of the ways to define functions, most should be familiar with them IMO.

Rating: 5 of 5

09.Mar.2018 at 14:08 by Kelly Griffiths (3 comments) via Web2 LIVE

I loved this! “Throwaway” variables always bugged me when I started to learn how to code. This is really an important core fundamental that every PHP developer should learn and use. The talk was very well-presented and moved at a perfect pace. While it may have been a litttle quick, it felt like we covered just the right amount of breadth and depth for an introduction.

Rating: 5 of 5

10.Mar.2018 at 13:24 by Maggie (2 comments) via Web2 LIVE

Very useful! Learned a few tricks that I would love to try somet ime!

Rating: 5 of 5

12.Mar.2018 at 18:49 by Kathryn Borrow (5 comments) via Web2 LIVE

Well done. Found some useful content that I plan to put to use.

© 2019