This screencast is part of my new book + video course, "Refactoring to Collections". Learn more about it here.
One of my absolute favorite collection refactorings is to combine the first
and contains
methods with higher order functions to turn repetitive loop-heavy code into short, expressive solutions that read like human speech.
In this quick screencast, I go over an example of how I used this approach combined with the Null Object pattern to clean up some duplication in the Nitpick CI codebase.
If you enjoyed this screencast, check out my new book + video course, "Refactoring to Collections".
It covers fundamental topics like imperative vs. declarative programming, understanding higher order functions, and includes 4 hours of screencasts going over refactorings like the one in this post.
Check out the website to learn more, or subscribe below for a free chapter sample.