DEV Community

Discussion on: Advent of Ruby 3.0 - Day 03 - Toboggan Trajectory

Collapse
 
baweaver profile image
Brandon Weaver

On 1: Enumerable#count vs Enumerable#reduce you're correct, but I did it intentionally to set up the Monoid intro as something that is "reducible" is by its nature parallelizeable if you can express it like I did before mentioning that.

On 2: Array#slice and Range#% are a lot of fun, though I still prefer Range#step for clarity. Truthfully I wasn't sure that'd work either with slice and was pleasantly surprised.

On 3: Granted my entire "Reducing Enumerable" talk was a very thinly veiled Monoid tutorial, and that always gets some fun reactions when I tell people that's what they just learned. People like using mathematical terms to teach people who don't know math terms, and predictably it doesn't fit their internal metaphor catalogue. Conversely this would probably annoy a mathematician.

On 4: I feel like I'm right there. I could make this work with threads and TruffleRuby but I want to get it to work T_T