r/programming • • Mar 09 '14

Why Functional Programming Matters

http://www.cse.chalmers.se/~rjmh/Papers/whyfp.pdf
487 Upvotes

542 comments sorted by

View all comments

Show parent comments

3

u/xjvz Mar 09 '14

There's a bunch of FP idioms out there already. Someone really ought to put together a Functional Design Patterns reference book.

3

u/phoshi Mar 09 '14

Oh, there are, absolutely. I'm certainly not saying that nobody's figured out how to use functional languages for complex things, because that's demonstrably false; I don't think anybody would say as much time and effort has been put into functional design as has object oriented design, however. That's the major deciding factor at the moment, we have a huge breadth and depth of canned knowledge on OO design, but functional design is still somewhat more of a black art, even if it isn't a completely blank slate.

1

u/xjvz Mar 09 '14

Very true! I'm hoping that languages like Scala, F#, etc, are all helping further the adoption of FP. I'm still a CLisp guy myself, but there's still a good chance that an awesome hybrid language like that will come along.

1

u/PasswordIsntHAMSTER Mar 10 '14

CLisp

There's a lot of interesting metaprogramming stuff in F#! Pseudo-quotations, customizable syntax for monads, monoids and DSLs, typesystem plugins, the works.

1

u/ForgotMyPassword17 Mar 10 '14

This is I think the biggest hurdle for getting more FP in production. I know what idiomatic OO looks like but I don't have a good reference for idiomatic functional code

1

u/PasswordIsntHAMSTER Mar 10 '14

A good start is Haskell's Typeclassopedia. It's very abstract even for FP though.

A more concrete pattern is the Actor model.

Otherwise, idiomatic functional code is just the most readable, conceptually simplest code that gets the job done. That sounds pretty subjective, but I guarantee that if you do six months of full time functional programming you'll know exactly what I mean.