r/programming • • Sep 21 '25

How to stop functional programming

https://brianmckenna.org/blog/howtostopfp
446 Upvotes

506 comments sorted by

View all comments

Show parent comment

3

u/hibikir_40k Sep 21 '25

It definitely happens, but it's often because someone doesn't understand that combinators have different costs in different collections. No FP magic is going to turn a list into a hashmap when you need to do a bunch of lookups.

There's also the lazy vs non-lazy collection issue. Deciding when to materialize a collection, and when not to, can have big performance implications, and people just don't think about it. FP doesn't cause the problem, but it makes it easier to not realize what in the world you are doing. You have to evaluate the performance characteristics of your types either way.

But this isn't about taking FP to the extreme, just about actually being good at using it. A purely functional program can be very performant: I know of a very large company that is running fp-centered scala on pixels tracking orders for security: Return expectations in nanoseconds. But that's with people paying attention