Rethinking Loops


Comments are closed.

Taylor Otwell at 14:43 on 9 Apr 2016

Such a good topic! Well presented intro into getting rid of loop cruft. Love it.

The description doesn't lie. This does change the way in which we think about loops.
The talk was very informative and brought a new way of looking at tackling (and avoiding) loops for cleaner more descriptive code.

Jason Goodman at 14:56 on 9 Apr 2016

Well presented. Interested to try some of these soon.

Colin O'Dell at 15:00 on 9 Apr 2016

I've been using functional programming concepts in PHP for a while but never thought to use a collection pipeline. I'll definitely be integrating those packages into my projects.

Great talk!

Chris at 15:05 on 9 Apr 2016

Great challenge to the common use of explicit loops in our interpreted languages. +1 for anticipating my question about performance.

Great automated example of how to clean up code.

kyle sloan at 17:14 on 9 Apr 2016

Enjoyed the talk, really made me think about the speed of writing code, vs being able to read it later.

I personally haven't used array map/reduce/filter so a brief description of the purpose on the slides of the function. You gave an example, and maybe you said it out loud, but I was deep in thought/read digestion of the code on the slide.

Mark Priddy at 20:03 on 9 Apr 2016

Rethinking Loops? I was expecting another talk on the humorously named IteratorIterator. What I got instead was astonishing - nothing less than chaining built in array processors to completely remove loops.

This one made me really ponder what I'm doing. All I could think was that I need to REFACTOR!!! Very concise.

moazzam khan at 22:37 on 9 Apr 2016

Great talk. I liked this one better than the others I attended.

One thing though: using plain numbers (instead of variables) may not always be a good idea (like age). It is not always clear what the number is supposed to represent so maybe assign it to a constant (if not a variable). I do agree, though, if a variable is being used only once then it's better to just use the method call() instead of assigning the value to a variable and then using the variable.

I benchmarked the performance of array_map() vs foreach loop and array_map was always slower than foreach (and foreach is slightly slower than for loop). If speed is primary concern then using array_map() , array_reduce() might not be a good idea. I haven't benchmarked this for PHP7, yet so I'm not sure how PHP7 handles it.

This is a great topic! I am always looking for ways to eliminate loops and with this information I am ready to find new ways.

Keith Casey at 11:36 on 11 Apr 2016

So I walked into this one with more intrigue than interest and I'm sincerely glad I did..

I default to loops most of the time because they're a nice hammer that I know. Using map reduce concepts to collapse and simplify loops is a powerful approach that I hadn't considered.

This is one of the few decks I've bookmarked to come back to later.

David Trower at 17:15 on 21 Apr 2016

Interesting topic at how to avoid using loops. While I think some of them might be overkill just to avoid doing a loop, the talk was great at causing people to think of different ways to code without relying on loops all the time.