3 ms·
Interesting. I find composing operators on streams to require holding less in my head than the equivalent non-point-free (ie, iterative / loop-based) code. Wh
by finnh 10y ago
Interesting. I find composing operators on streams to require holding less in my head than the equivalent non-point-free (ie, iterative / loop-based) code.
When reading (eg) nested for loops with conditions, I have to push a ton of context variables into my head, and then evolve them over iterations if I'm doing a close read. That's a lot of ask of my head.
But in the point-free style, each compositional unit tends to be small enough to be "obviously no bugs" vs. "no obvious bugs".
- comex 10y agoAll things in moderation. Chaining list transforms (like map and filter) in one expression does have fewer points than giving every intermediate result a name or even using a for loop, but it doesn't require the level of tenseness usually associated with the term "point-free".
- mpweiher 10y agoI think you're mixing up "higher order" code and "point-free" code. Just because you don't go point-free doesn't mean you have to resort to nested for-loops.