Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RubyConf 2018 - Reducing Enumerable - An Illustrated Adventure by Brandon Weaver Meet Red. Red is a reducing lemur, and he loves to sum things using the reduce method. The problem is, with Ruby 2.4+ and the sum method he's starting to think reduce isn't that useful anymore. Distraught, Red asks his master for advice, and she sends him off on a grand journey to learn the true powers of the reduce method by reimplementing various methods from Enumerable. Join Red on an illustrated adventure through the land of Enumerable as he learns to map, select, find, and more using his trusty reduce. If you're new to Ruby and Functional Programming, this is the talk for you.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
The video titled "Reducing Enumerable - An Illustrated Adventure" features Brandon Weaver and was presented at RubyConf 2018. This engaging presentation follows the whimsical journey of Red, a reducing lemur, as he explores the capabilities of the `reduce` method in Ruby, especially in the context of newer methods introduced in Ruby 2.4, such as `sum`. **Key Points Discussed:** - **Introduction of Reduce:** - Red loves to use `reduce` to sum values. - `reduce` starts with an accumulator and processes a list by combining values using a designated method. - **Ruby's `sum` Method:** - The introduction of `sum` in Ruby 2.4 raises questions about the necessity of `reduce`. - Red learns that `reduce` can do more than just summing—it can apply different operations and work with structures beyond simple numbers. - **Adventures with Masters of Enumerable:** - Red embarks on a quest to learn from three masters: - **Master of Map:** - `map` transforms the original collection and retrieves a new list based on a function applied to each element. Red learns to implement mapping using `reduce`. - **Master of Select:** - `select` filters elements based on a condition. Red discovers how to apply `select` operations utilizing `reduce` to build a new array of elements meeting the criteria. - **Master of Find:** - `find` retrieves the first element meeting the condition. Red learns to implement `find` using fold-like behavior of `reduce` by leveraging early termination when a match is found. - **Advanced Usage of Reduce:** - Red’s journey concludes by discussing how `reduce` can handle more complex operations, like counting occurrences using a hash (tally by), and how understanding the functional programming aspects can enhance coding practices. - **Conclusion and Reflection:** - The master reminds Red that `reduce` is not obsolete; it serves its own purpose where other more direct methods may not suffice. - The real power lies in making informed choices about which methods to use based on the problem context rather than defaulting to one approach. - **Final Thoughts:** - The journey embodies the idea that there are always new avenues to explore in programming, and creativity in using methods like `reduce` can lead to innovative solutions and better understanding of functional programming principles. The session closes with a sense of humor and anticipation for future explorations in Ruby's capabilities, showcasing the importance of community engagement and the potential for continuous learning.
Suggest modifications
Cancel