DEV Community

Cover image for Can I do FP in my language?

Can I do FP in my language?

Eric Normand on August 07, 2017

A very common question I get from experienced programmers is "What does an FP language give me that I don't already have? Can't I just do FP in my ...
Collapse
 
kspeakman profile image
Kasey Speakman

Elm is a good one to get your feet wet too (and develop HTML5 UIs in the process). Because all your Elm code is purely functional, refactoring is quite safe... make your changes and then fix all the compiler errors, and it probably just works. This reduces the penalty for early mistakes.

Collapse
 
ericnormand profile image
Eric Normand

Elm is awesome for learning functional programming!

Collapse
 
ben profile image
Ben Halpern

I really want an excuse to use Elm in a real-world context. Still haven't needed it, but still excited about the language.

Thread Thread
 
kspeakman profile image
Kasey Speakman

It's good for applications, maybe less so for content-based websites. (Based on your preact post and concern with deployed size.) Give it a try for some internal tools and see what you think.

I've found that where the difficulty lies in Elm is backwards from most UI frameworks. Most of them are easy/moderate to get going, but become increasingly hard to maintain over time. Elm requires a little bit more effort to get started up front (adjusting to FP mainly), but maintenance difficulty doesn't increase much over time. Maintenance is still work, but not particularly risky work.

We use it production, both internal and customer-facing.

Collapse
 
mpodlodowski profile image
Marcin Podlodowski

Having many different ways to solve a problem comes with great amount of expertise needed to pick the best one.
I need to try Clojure once more :) Thank you for the reading!

Collapse
 
ericnormand profile image
Eric Normand

I couldn't agree more! You're welcome!

Collapse
 
theodesp profile image
Theofanis Despoudis

Yes. You can do it in Go also as it supports closures.

Collapse
 
stefandjokic profile image
Stefan Đokić

you should have just said "yes" 😂

Collapse
 
ericnormand profile image
Eric Normand

What a blog that would be! Maybe we could start a new social network where we answer yes or now questions. The UI to answer is just 2 radio buttons. ;)

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

Yes, programming paradigms are not the same as programming languages. I've been writing a lot about this lately over at mortoray.com/topics/paradigms/

Collapse
 
ultimate1352 profile image
kLawrence

I will read it :) Thanks.