top | item 20644978

(no title)

ps101 | 6 years ago

What's the more general pitch for learning a functional language in the first place?

discuss

order

a-saleh|6 years ago

I don't think there is a general one anymore.

The original "wouldn't it be better if we just passed data around through simple composable functions" kinda won, you have first-class anonymous functions with support for closures in most languages today in use :-)

I think the next pitch is along the lines of "We can solve the evil of mutable state making your app hard to debug/test" and i.m.o. that took over a bit as well, i.e. with frontend we usually have state in one tree sitting somewhere and what we display is just a function from state to our html.

And I have seen the state being represented as a fold/reduce over events in the application.

So the pitch i.m.o. is along the lines "Hey, we converged on the idea that functional programming is good, why not use language that has good support for it" :D

dagw|6 years ago

It forces you to learn a new and different way of thinking about programming and solving software problems. Even if you never end up actually using a functional language, many of the techniques and approaches you learn can be applied in all languages.

Learning Haskell was probably the single best thing I've done with regards to becoming a better programmer even I've never really written much Haskell since then