r/functionalprogramming • • Jul 05 '23

FP Fearless Tinkering is Functional

https://www.heneli.dev/blog/fearless-tinkering-is-functional
12 Upvotes

3 comments sorted by

View all comments

Show parent comment

3

u/martingronlund Jul 06 '23

As someone who has grown proficient with both, I think inlining procedural code is great, as this promotes a deep understanding of details. Levels of indirection should be carefully introduced and vigorously removed (and are not to be confused with abstractions, which explicitly promote a lack of understanding of internals). Generally, to write the best program, we must understand most of the details at both a high and low level. Indirections and abstractions should be few yet powerful.

When we have powerful abstract constructs baked into the language AND they don't impact runtime performance, I agree 100%, but optimizing e.g. Haskell for performance can be notoriously difficult, because yes you can mathematically move things around without fear of "incorrectness" in a trivial sense - but you may very well cause huge differences in non-functional behaviour! We should consider these too!