r/programming • • May 15 '18

Demystifying functional programming (in a real company)

https://medium.com/building-nubank/demystifying-functional-programming-in-a-real-company-e954a2591504
127 Upvotes

51 comments sorted by

View all comments

36

u/arbitrarycivilian May 16 '18

I think it's great to point out that you don't need to have a PhD in category theory to take advantage of functional programming. Monads are certainly overblown.

But one feature which I find equally indispensable in functional programming, and which Clojure lacks, is algebraic data types. To me FP without ADTs is like OOP without interfaces.

15

u/makeshift_mike May 16 '18

You don’t even need to be using a functional language to take advantage of FP. There’s a great article called Functional Programming in C++ where John Carmack talks about general FP principles like immutability and minimizing shared state, applied to a language that’s pretty far from functional.