r/functionalprogramming • • Sep 23 '19

FP Who cares about functional programming?

https://thomasbandt.com/who-cares-about-functional-programming
25 Upvotes

2 comments sorted by

7

u/adamtait Sep 23 '19

Killer apps? I feel like there are lots to choose from but have seen slow adoption outside of their language-specific community. Instead, I see a few other road blocks:

  1. Education. No matter what path an engineer takes in their education, they are likely to be taught Object Oriented languages and thinking first. Once you start thinking about code in that way, it's difficult to change.

  2. Investment. There are lots of powerful libraries and uses of functional languages but there are good (or at least possible) alternatives in OO languages (that you're already working with). As a technology leader with engineers reporting to me (who, for example, already work in Java), why invest in re-educating the team in a new language (that I'm also unfamiliar with) when it's hard to see the benefits.

  3. Invisible benefits. I think this is where the killer app idea comes from. Benefits from switching to FP are difficult to see, especially when you don't understand how FP languages work (or how engineers work). Things like fewer lines of code, simpler control flow, better abstractions are hard to translate into business objectives (how do I more quickly/efficiently deliver my goals?). Unfortunately, most of the software industry is still struggling to understand & value to long term cost of running/maintaining/improving software.

All these hurdles are entirely mental; learning new things, valuing software and the work that goes into building it appropriately. Since Kahneman & Tversky showed that people tend to stick to the familiar, I think that FP will continue to be the superpower of the few for the foreseeable future (at least in my lifetime).

4

u/[deleted] Sep 24 '19

No matter what path an engineer takes in their education, they are likely to be taught Object Oriented languages and thinking first. Once you start thinking about code in that way, it's difficult to change.

I looked into that as well – there are studies backing that argument. On the other hand, junior devs coming from university or some kind of coding school do not make decisions on what paradigm or language to apply at their first job. They may apply to those jobs which require some skills they learned, though.

As a technology leader with engineers reporting to me (who, for example, already work in Java), why invest in re-educating the team in a new language (that I'm also unfamiliar with) when it's hard to see the benefits.

It depends on the specific circumstances, let's say the experience level of the team etcetera. I did that two years ago, when facing a specific problem that could hardly be solved in C# the same way it could in F#. So I introduced F# to the team, and they adopted it surprisingly fast and well. Now I have a hard time to argue against it for new stuff I think OOP and C# would be the smarter choice for (for business reasons).

Unfortunately, most of the software industry is still struggling to understand & value to long term cost of running/maintaining/improving software.

That's correct. And maybe my perspective is a little bit influenced by being involved in larger scale mobile applications in the last years, where we had to deal with all sorts of negative side-effects that typically occur when you build stuff with a heterogeneous team over a long period of time. It became obvious to the team that things like immutability would have helped us tremendously. Which is where functional ideas like The Elm Architecture etcetera shine. So, maybe the benefits become visible to more and more people over time.