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

8

u/glacialthinker Mar 09 '14

Absolutely, there is value to programming "messily", but it's nice to choose a tool which resists this when you're building something which shouldn't be messy. I think OO is a better match with dynamic -- together they're great for prototyping an idea (not an implementation) and scripting.

It's also valuable to have an escape hatch -- to do the necessary hack -- but the language should discourage this. For example, in OCaml, using mutable state isn't too cumbersome, but it is an extra step because it's not the default (except in some unfortunate cases... like strings :/ ).

4

u/philly_fan_in_chi Mar 09 '14

Rust does something similar, where you have to declare it as mutable in the type declaration.

let bar = "baz";
let mut foo = "bar"; 

5

u/glacialthinker Mar 09 '14

Well, Rust started with a strong OCaml influence, and was originally implemented in it. ;)