DEV Community

Discussion on: Does functional programming have any advantage in real environments?

Collapse
 
sirseanofloxley profile image
Sean Allin Newell

I would also pile on the Elm recommendations. FP has many faces and iterations, and varied benefits across those incarnations. I'll focus on Elm.

I think Elm offers a more pleasant developer experience compared to JS and its various libraries/frameworks. It also leans into value or data driven design and programming which lends itself to pipelines and transformations. Imagine Javascript promise chains (.then...) or array manipulations (.map . filter) or C# linq queries or Java 8+ style code if youvet seen any of those examples. Elm/FP also offer more powerful compilation checks that can lead to generative testing that automatically check boundary conditions and increase your confidence in your code. Because of those checks, global and local refactorings are common, encouraged, and extremely low risk. I think this is particularly valuable in product saas companies where markets and products can change so much we need a way to accomodate change.

FP, to me, affords me more tools to write more reusable code than compared to a more OO language.