4 ms·
Having done a lot of programming in Postscript, I understand the allure of point-free style. Some code can seem extremely elegant, but mostly it's just clever,
by mpweiher 10y ago
Having done a lot of programming in Postscript, I understand the allure of point-free style.
Some code can seem extremely elegant, but mostly it's just clever, and an exercise in showing off how smart you are and how much you can keep in your head.
And with all due respect to Joe Condon: Eschew clever code.
- finnh 10y agoInteresting. 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.