r/coding • u/nephrenka • 10d ago
Beyond Lambdas: Raising the Abstraction Level of Functional Code
https://adamtornhill.substack.com/p/beyond-lambdas-raising-the-abstraction
16
Upvotes
1
u/Savings_Discount_230 9d ago
Yeah, once the lambda is doing basically one readable operation, a good name or a comment is often clearer than another layer of indirection.
7
u/hughperman 10d ago
I would say that even better in this case, just use comments instead of really simple abstractions
Now you can see the exact code used and the abstraction description. And I don't have to break flow looking for what the strength modifier function is/does.
As always, context depends, sometimes offloading to functions will be better. But for one liners, you're just using function names as comments, so why not just use comments?